proteus  1.7.4
C/C++/Fortran libraries
superluWrappers.c
Go to the documentation of this file.
1 /* Generated by Cython 0.29.16 */
2 
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6  #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8  #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_29_16"
11 #define CYTHON_HEX_VERSION 0x001D10F0
12 #define CYTHON_FUTURE_DIVISION 0
13 #include <stddef.h>
14 #ifndef offsetof
15  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #endif
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
18  #ifndef __stdcall
19  #define __stdcall
20  #endif
21  #ifndef __cdecl
22  #define __cdecl
23  #endif
24  #ifndef __fastcall
25  #define __fastcall
26  #endif
27 #endif
28 #ifndef DL_IMPORT
29  #define DL_IMPORT(t) t
30 #endif
31 #ifndef DL_EXPORT
32  #define DL_EXPORT(t) t
33 #endif
34 #define __PYX_COMMA ,
35 #ifndef HAVE_LONG_LONG
36  #if PY_VERSION_HEX >= 0x02070000
37  #define HAVE_LONG_LONG
38  #endif
39 #endif
40 #ifndef PY_LONG_LONG
41  #define PY_LONG_LONG LONG_LONG
42 #endif
43 #ifndef Py_HUGE_VAL
44  #define Py_HUGE_VAL HUGE_VAL
45 #endif
46 #ifdef PYPY_VERSION
47  #define CYTHON_COMPILING_IN_PYPY 1
48  #define CYTHON_COMPILING_IN_PYSTON 0
49  #define CYTHON_COMPILING_IN_CPYTHON 0
50  #undef CYTHON_USE_TYPE_SLOTS
51  #define CYTHON_USE_TYPE_SLOTS 0
52  #undef CYTHON_USE_PYTYPE_LOOKUP
53  #define CYTHON_USE_PYTYPE_LOOKUP 0
54  #if PY_VERSION_HEX < 0x03050000
55  #undef CYTHON_USE_ASYNC_SLOTS
56  #define CYTHON_USE_ASYNC_SLOTS 0
57  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58  #define CYTHON_USE_ASYNC_SLOTS 1
59  #endif
60  #undef CYTHON_USE_PYLIST_INTERNALS
61  #define CYTHON_USE_PYLIST_INTERNALS 0
62  #undef CYTHON_USE_UNICODE_INTERNALS
63  #define CYTHON_USE_UNICODE_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_WRITER
65  #define CYTHON_USE_UNICODE_WRITER 0
66  #undef CYTHON_USE_PYLONG_INTERNALS
67  #define CYTHON_USE_PYLONG_INTERNALS 0
68  #undef CYTHON_AVOID_BORROWED_REFS
69  #define CYTHON_AVOID_BORROWED_REFS 1
70  #undef CYTHON_ASSUME_SAFE_MACROS
71  #define CYTHON_ASSUME_SAFE_MACROS 0
72  #undef CYTHON_UNPACK_METHODS
73  #define CYTHON_UNPACK_METHODS 0
74  #undef CYTHON_FAST_THREAD_STATE
75  #define CYTHON_FAST_THREAD_STATE 0
76  #undef CYTHON_FAST_PYCALL
77  #define CYTHON_FAST_PYCALL 0
78  #undef CYTHON_PEP489_MULTI_PHASE_INIT
79  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80  #undef CYTHON_USE_TP_FINALIZE
81  #define CYTHON_USE_TP_FINALIZE 0
82  #undef CYTHON_USE_DICT_VERSIONS
83  #define CYTHON_USE_DICT_VERSIONS 0
84  #undef CYTHON_USE_EXC_INFO_STACK
85  #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87  #define CYTHON_COMPILING_IN_PYPY 0
88  #define CYTHON_COMPILING_IN_PYSTON 1
89  #define CYTHON_COMPILING_IN_CPYTHON 0
90  #ifndef CYTHON_USE_TYPE_SLOTS
91  #define CYTHON_USE_TYPE_SLOTS 1
92  #endif
93  #undef CYTHON_USE_PYTYPE_LOOKUP
94  #define CYTHON_USE_PYTYPE_LOOKUP 0
95  #undef CYTHON_USE_ASYNC_SLOTS
96  #define CYTHON_USE_ASYNC_SLOTS 0
97  #undef CYTHON_USE_PYLIST_INTERNALS
98  #define CYTHON_USE_PYLIST_INTERNALS 0
99  #ifndef CYTHON_USE_UNICODE_INTERNALS
100  #define CYTHON_USE_UNICODE_INTERNALS 1
101  #endif
102  #undef CYTHON_USE_UNICODE_WRITER
103  #define CYTHON_USE_UNICODE_WRITER 0
104  #undef CYTHON_USE_PYLONG_INTERNALS
105  #define CYTHON_USE_PYLONG_INTERNALS 0
106  #ifndef CYTHON_AVOID_BORROWED_REFS
107  #define CYTHON_AVOID_BORROWED_REFS 0
108  #endif
109  #ifndef CYTHON_ASSUME_SAFE_MACROS
110  #define CYTHON_ASSUME_SAFE_MACROS 1
111  #endif
112  #ifndef CYTHON_UNPACK_METHODS
113  #define CYTHON_UNPACK_METHODS 1
114  #endif
115  #undef CYTHON_FAST_THREAD_STATE
116  #define CYTHON_FAST_THREAD_STATE 0
117  #undef CYTHON_FAST_PYCALL
118  #define CYTHON_FAST_PYCALL 0
119  #undef CYTHON_PEP489_MULTI_PHASE_INIT
120  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121  #undef CYTHON_USE_TP_FINALIZE
122  #define CYTHON_USE_TP_FINALIZE 0
123  #undef CYTHON_USE_DICT_VERSIONS
124  #define CYTHON_USE_DICT_VERSIONS 0
125  #undef CYTHON_USE_EXC_INFO_STACK
126  #define CYTHON_USE_EXC_INFO_STACK 0
127 #else
128  #define CYTHON_COMPILING_IN_PYPY 0
129  #define CYTHON_COMPILING_IN_PYSTON 0
130  #define CYTHON_COMPILING_IN_CPYTHON 1
131  #ifndef CYTHON_USE_TYPE_SLOTS
132  #define CYTHON_USE_TYPE_SLOTS 1
133  #endif
134  #if PY_VERSION_HEX < 0x02070000
135  #undef CYTHON_USE_PYTYPE_LOOKUP
136  #define CYTHON_USE_PYTYPE_LOOKUP 0
137  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138  #define CYTHON_USE_PYTYPE_LOOKUP 1
139  #endif
140  #if PY_MAJOR_VERSION < 3
141  #undef CYTHON_USE_ASYNC_SLOTS
142  #define CYTHON_USE_ASYNC_SLOTS 0
143  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144  #define CYTHON_USE_ASYNC_SLOTS 1
145  #endif
146  #if PY_VERSION_HEX < 0x02070000
147  #undef CYTHON_USE_PYLONG_INTERNALS
148  #define CYTHON_USE_PYLONG_INTERNALS 0
149  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150  #define CYTHON_USE_PYLONG_INTERNALS 1
151  #endif
152  #ifndef CYTHON_USE_PYLIST_INTERNALS
153  #define CYTHON_USE_PYLIST_INTERNALS 1
154  #endif
155  #ifndef CYTHON_USE_UNICODE_INTERNALS
156  #define CYTHON_USE_UNICODE_INTERNALS 1
157  #endif
158  #if PY_VERSION_HEX < 0x030300F0
159  #undef CYTHON_USE_UNICODE_WRITER
160  #define CYTHON_USE_UNICODE_WRITER 0
161  #elif !defined(CYTHON_USE_UNICODE_WRITER)
162  #define CYTHON_USE_UNICODE_WRITER 1
163  #endif
164  #ifndef CYTHON_AVOID_BORROWED_REFS
165  #define CYTHON_AVOID_BORROWED_REFS 0
166  #endif
167  #ifndef CYTHON_ASSUME_SAFE_MACROS
168  #define CYTHON_ASSUME_SAFE_MACROS 1
169  #endif
170  #ifndef CYTHON_UNPACK_METHODS
171  #define CYTHON_UNPACK_METHODS 1
172  #endif
173  #ifndef CYTHON_FAST_THREAD_STATE
174  #define CYTHON_FAST_THREAD_STATE 1
175  #endif
176  #ifndef CYTHON_FAST_PYCALL
177  #define CYTHON_FAST_PYCALL 1
178  #endif
179  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
181  #endif
182  #ifndef CYTHON_USE_TP_FINALIZE
183  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
184  #endif
185  #ifndef CYTHON_USE_DICT_VERSIONS
186  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
187  #endif
188  #ifndef CYTHON_USE_EXC_INFO_STACK
189  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
190  #endif
191 #endif
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
194 #endif
195 #if CYTHON_USE_PYLONG_INTERNALS
196  #include "longintrepr.h"
197  #undef SHIFT
198  #undef BASE
199  #undef MASK
200  #ifdef SIZEOF_VOID_P
201  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
202  #endif
203 #endif
204 #ifndef __has_attribute
205  #define __has_attribute(x) 0
206 #endif
207 #ifndef __has_cpp_attribute
208  #define __has_cpp_attribute(x) 0
209 #endif
210 #ifndef CYTHON_RESTRICT
211  #if defined(__GNUC__)
212  #define CYTHON_RESTRICT __restrict__
213  #elif defined(_MSC_VER) && _MSC_VER >= 1400
214  #define CYTHON_RESTRICT __restrict
215  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216  #define CYTHON_RESTRICT restrict
217  #else
218  #define CYTHON_RESTRICT
219  #endif
220 #endif
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 # define CYTHON_UNUSED __attribute__ ((__unused__))
225 # else
226 # define CYTHON_UNUSED
227 # endif
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 # define CYTHON_UNUSED __attribute__ ((__unused__))
230 # else
231 # define CYTHON_UNUSED
232 # endif
233 #endif
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 # if defined(__cplusplus)
236  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
237 # else
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
239 # endif
240 #endif
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 # define CYTHON_NCP_UNUSED
244 # else
245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
246 # endif
247 #endif
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
249 #ifdef _MSC_VER
250  #ifndef _MSC_STDINT_H_
251  #if _MSC_VER < 1300
252  typedef unsigned char uint8_t;
253  typedef unsigned int uint32_t;
254  #else
255  typedef unsigned __int8 uint8_t;
256  typedef unsigned __int32 uint32_t;
257  #endif
258  #endif
259 #else
260  #include <stdint.h>
261 #endif
262 #ifndef CYTHON_FALLTHROUGH
263  #if defined(__cplusplus) && __cplusplus >= 201103L
264  #if __has_cpp_attribute(fallthrough)
265  #define CYTHON_FALLTHROUGH [[fallthrough]]
266  #elif __has_cpp_attribute(clang::fallthrough)
267  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268  #elif __has_cpp_attribute(gnu::fallthrough)
269  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
270  #endif
271  #endif
272  #ifndef CYTHON_FALLTHROUGH
273  #if __has_attribute(fallthrough)
274  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
275  #else
276  #define CYTHON_FALLTHROUGH
277  #endif
278  #endif
279  #if defined(__clang__ ) && defined(__apple_build_version__)
280  #if __apple_build_version__ < 7000000
281  #undef CYTHON_FALLTHROUGH
282  #define CYTHON_FALLTHROUGH
283  #endif
284  #endif
285 #endif
286 
287 #ifndef CYTHON_INLINE
288  #if defined(__clang__)
289  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
290  #elif defined(__GNUC__)
291  #define CYTHON_INLINE __inline__
292  #elif defined(_MSC_VER)
293  #define CYTHON_INLINE __inline
294  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
295  #define CYTHON_INLINE inline
296  #else
297  #define CYTHON_INLINE
298  #endif
299 #endif
300 
301 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
302  #define Py_OptimizeFlag 0
303 #endif
304 #define __PYX_BUILD_PY_SSIZE_T "n"
305 #define CYTHON_FORMAT_SSIZE_T "z"
306 #if PY_MAJOR_VERSION < 3
307  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
308  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
309  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
310  #define __Pyx_DefaultClassType PyClass_Type
311 #else
312  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
313 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
314  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
315  PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
316 #else
317  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
318  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
319 #endif
320  #define __Pyx_DefaultClassType PyType_Type
321 #endif
322 #ifndef Py_TPFLAGS_CHECKTYPES
323  #define Py_TPFLAGS_CHECKTYPES 0
324 #endif
325 #ifndef Py_TPFLAGS_HAVE_INDEX
326  #define Py_TPFLAGS_HAVE_INDEX 0
327 #endif
328 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
329  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
330 #endif
331 #ifndef Py_TPFLAGS_HAVE_FINALIZE
332  #define Py_TPFLAGS_HAVE_FINALIZE 0
333 #endif
334 #ifndef METH_STACKLESS
335  #define METH_STACKLESS 0
336 #endif
337 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
338  #ifndef METH_FASTCALL
339  #define METH_FASTCALL 0x80
340  #endif
341  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
342  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
343  Py_ssize_t nargs, PyObject *kwnames);
344 #else
345  #define __Pyx_PyCFunctionFast _PyCFunctionFast
346  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
347 #endif
348 #if CYTHON_FAST_PYCCALL
349 #define __Pyx_PyFastCFunction_Check(func)\
350  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
351 #else
352 #define __Pyx_PyFastCFunction_Check(func) 0
353 #endif
354 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
355  #define PyObject_Malloc(s) PyMem_Malloc(s)
356  #define PyObject_Free(p) PyMem_Free(p)
357  #define PyObject_Realloc(p) PyMem_Realloc(p)
358 #endif
359 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
360  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
361  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
362  #define PyMem_RawFree(p) PyMem_Free(p)
363 #endif
364 #if CYTHON_COMPILING_IN_PYSTON
365  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
366  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
367 #else
368  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
369  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
370 #endif
371 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
372  #define __Pyx_PyThreadState_Current PyThreadState_GET()
373 #elif PY_VERSION_HEX >= 0x03060000
374  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
375 #elif PY_VERSION_HEX >= 0x03000000
376  #define __Pyx_PyThreadState_Current PyThreadState_GET()
377 #else
378  #define __Pyx_PyThreadState_Current _PyThreadState_Current
379 #endif
380 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
381 #include "pythread.h"
382 #define Py_tss_NEEDS_INIT 0
383 typedef int Py_tss_t;
384 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
385  *key = PyThread_create_key();
386  return 0;
387 }
388 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
389  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
390  *key = Py_tss_NEEDS_INIT;
391  return key;
392 }
393 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
394  PyObject_Free(key);
395 }
396 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
397  return *key != Py_tss_NEEDS_INIT;
398 }
399 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
400  PyThread_delete_key(*key);
401  *key = Py_tss_NEEDS_INIT;
402 }
403 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
404  return PyThread_set_key_value(*key, value);
405 }
406 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
407  return PyThread_get_key_value(*key);
408 }
409 #endif
410 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
411 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
412 #else
413 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
414 #endif
415 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
416  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
417  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
418 #else
419  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
420  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
421 #endif
422 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
423 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
424 #else
425 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
426 #endif
427 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
428  #define CYTHON_PEP393_ENABLED 1
429  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
430  0 : _PyUnicode_Ready((PyObject *)(op)))
431  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
432  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
433  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
434  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
435  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
436  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
437  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
438  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
439 #else
440  #define CYTHON_PEP393_ENABLED 0
441  #define PyUnicode_1BYTE_KIND 1
442  #define PyUnicode_2BYTE_KIND 2
443  #define PyUnicode_4BYTE_KIND 4
444  #define __Pyx_PyUnicode_READY(op) (0)
445  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
446  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
447  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
448  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
449  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
450  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
451  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
452  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
453 #endif
454 #if CYTHON_COMPILING_IN_PYPY
455  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
456  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
457 #else
458  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
459  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
460  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
461 #endif
462 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
463  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
464 #endif
465 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
466  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
467 #endif
468 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
469  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
470 #endif
471 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
472 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
473 #if PY_MAJOR_VERSION >= 3
474  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
475 #else
476  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
477 #endif
478 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
479  #define PyObject_ASCII(o) PyObject_Repr(o)
480 #endif
481 #if PY_MAJOR_VERSION >= 3
482  #define PyBaseString_Type PyUnicode_Type
483  #define PyStringObject PyUnicodeObject
484  #define PyString_Type PyUnicode_Type
485  #define PyString_Check PyUnicode_Check
486  #define PyString_CheckExact PyUnicode_CheckExact
487 #ifndef PyObject_Unicode
488  #define PyObject_Unicode PyObject_Str
489 #endif
490 #endif
491 #if PY_MAJOR_VERSION >= 3
492  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
493  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
494 #else
495  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
496  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
497 #endif
498 #ifndef PySet_CheckExact
499  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
500 #endif
501 #if CYTHON_ASSUME_SAFE_MACROS
502  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
503 #else
504  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
505 #endif
506 #if PY_MAJOR_VERSION >= 3
507  #define PyIntObject PyLongObject
508  #define PyInt_Type PyLong_Type
509  #define PyInt_Check(op) PyLong_Check(op)
510  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
511  #define PyInt_FromString PyLong_FromString
512  #define PyInt_FromUnicode PyLong_FromUnicode
513  #define PyInt_FromLong PyLong_FromLong
514  #define PyInt_FromSize_t PyLong_FromSize_t
515  #define PyInt_FromSsize_t PyLong_FromSsize_t
516  #define PyInt_AsLong PyLong_AsLong
517  #define PyInt_AS_LONG PyLong_AS_LONG
518  #define PyInt_AsSsize_t PyLong_AsSsize_t
519  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
520  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
521  #define PyNumber_Int PyNumber_Long
522 #endif
523 #if PY_MAJOR_VERSION >= 3
524  #define PyBoolObject PyLongObject
525 #endif
526 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
527  #ifndef PyUnicode_InternFromString
528  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
529  #endif
530 #endif
531 #if PY_VERSION_HEX < 0x030200A4
532  typedef long Py_hash_t;
533  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
534  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
535 #else
536  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
537  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
538 #endif
539 #if PY_MAJOR_VERSION >= 3
540  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
541 #else
542  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
543 #endif
544 #if CYTHON_USE_ASYNC_SLOTS
545  #if PY_VERSION_HEX >= 0x030500B1
546  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
547  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
548  #else
549  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
550  #endif
551 #else
552  #define __Pyx_PyType_AsAsync(obj) NULL
553 #endif
554 #ifndef __Pyx_PyAsyncMethodsStruct
555  typedef struct {
556  unaryfunc am_await;
557  unaryfunc am_aiter;
558  unaryfunc am_anext;
559  } __Pyx_PyAsyncMethodsStruct;
560 #endif
561 
562 #if defined(WIN32) || defined(MS_WINDOWS)
563  #define _USE_MATH_DEFINES
564 #endif
565 #include <math.h>
566 #ifdef NAN
567 #define __PYX_NAN() ((float) NAN)
568 #else
569 static CYTHON_INLINE float __PYX_NAN() {
570  float value;
571  memset(&value, 0xFF, sizeof(value));
572  return value;
573 }
574 #endif
575 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
576 #define __Pyx_truncl trunc
577 #else
578 #define __Pyx_truncl truncl
579 #endif
580 
581 
582 #define __PYX_ERR(f_index, lineno, Ln_error) \
583 { \
584  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
585 }
586 
587 #ifndef __PYX_EXTERN_C
588  #ifdef __cplusplus
589  #define __PYX_EXTERN_C extern "C"
590  #else
591  #define __PYX_EXTERN_C extern
592  #endif
593 #endif
594 
595 #define __PYX_HAVE__superluWrappers
596 #define __PYX_HAVE_API__superluWrappers
597 /* Early includes */
598 #include <string.h>
599 #include <stdio.h>
600 #include "numpy/arrayobject.h"
601 #include "numpy/ufuncobject.h"
602 #include "proteus_superlu.h"
603 #include <stdlib.h>
604 #include "pythread.h"
605 #include "pystate.h"
606 #ifdef _OPENMP
607 #include <omp.h>
608 #endif /* _OPENMP */
609 
610 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
611 #define CYTHON_WITHOUT_ASSERTIONS
612 #endif
613 
614 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
615  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
616 
617 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
618 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
619 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
620 #define __PYX_DEFAULT_STRING_ENCODING ""
621 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
622 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
623 #define __Pyx_uchar_cast(c) ((unsigned char)c)
624 #define __Pyx_long_cast(x) ((long)x)
625 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
626  (sizeof(type) < sizeof(Py_ssize_t)) ||\
627  (sizeof(type) > sizeof(Py_ssize_t) &&\
628  likely(v < (type)PY_SSIZE_T_MAX ||\
629  v == (type)PY_SSIZE_T_MAX) &&\
630  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
631  v == (type)PY_SSIZE_T_MIN))) ||\
632  (sizeof(type) == sizeof(Py_ssize_t) &&\
633  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
634  v == (type)PY_SSIZE_T_MAX))) )
635 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
636  return (size_t) i < (size_t) limit;
637 }
638 #if defined (__cplusplus) && __cplusplus >= 201103L
639  #include <cstdlib>
640  #define __Pyx_sst_abs(value) std::abs(value)
641 #elif SIZEOF_INT >= SIZEOF_SIZE_T
642  #define __Pyx_sst_abs(value) abs(value)
643 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
644  #define __Pyx_sst_abs(value) labs(value)
645 #elif defined (_MSC_VER)
646  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
647 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
648  #define __Pyx_sst_abs(value) llabs(value)
649 #elif defined (__GNUC__)
650  #define __Pyx_sst_abs(value) __builtin_llabs(value)
651 #else
652  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
653 #endif
654 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
655 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
656 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
657 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
658 #define __Pyx_PyBytes_FromString PyBytes_FromString
659 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
660 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
661 #if PY_MAJOR_VERSION < 3
662  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
663  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
664 #else
665  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
666  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
667 #endif
668 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
669 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
670 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
671 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
672 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
673 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
674 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
675 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
676 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
677 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
678 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
679 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
680 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
681 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
682 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
683 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
684 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
685  const Py_UNICODE *u_end = u;
686  while (*u_end++) ;
687  return (size_t)(u_end - u - 1);
688 }
689 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
690 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
691 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
692 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
693 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
694 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
695 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
696 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
697 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
698 #define __Pyx_PySequence_Tuple(obj)\
699  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
700 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
701 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
702 #if CYTHON_ASSUME_SAFE_MACROS
703 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
704 #else
705 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
706 #endif
707 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
708 #if PY_MAJOR_VERSION >= 3
709 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
710 #else
711 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
712 #endif
713 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
714 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
715 static int __Pyx_sys_getdefaultencoding_not_ascii;
716 static int __Pyx_init_sys_getdefaultencoding_params(void) {
717  PyObject* sys;
718  PyObject* default_encoding = NULL;
719  PyObject* ascii_chars_u = NULL;
720  PyObject* ascii_chars_b = NULL;
721  const char* default_encoding_c;
722  sys = PyImport_ImportModule("sys");
723  if (!sys) goto bad;
724  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
725  Py_DECREF(sys);
726  if (!default_encoding) goto bad;
727  default_encoding_c = PyBytes_AsString(default_encoding);
728  if (!default_encoding_c) goto bad;
729  if (strcmp(default_encoding_c, "ascii") == 0) {
730  __Pyx_sys_getdefaultencoding_not_ascii = 0;
731  } else {
732  char ascii_chars[128];
733  int c;
734  for (c = 0; c < 128; c++) {
735  ascii_chars[c] = c;
736  }
737  __Pyx_sys_getdefaultencoding_not_ascii = 1;
738  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
739  if (!ascii_chars_u) goto bad;
740  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
741  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
742  PyErr_Format(
743  PyExc_ValueError,
744  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
745  default_encoding_c);
746  goto bad;
747  }
748  Py_DECREF(ascii_chars_u);
749  Py_DECREF(ascii_chars_b);
750  }
751  Py_DECREF(default_encoding);
752  return 0;
753 bad:
754  Py_XDECREF(default_encoding);
755  Py_XDECREF(ascii_chars_u);
756  Py_XDECREF(ascii_chars_b);
757  return -1;
758 }
759 #endif
760 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
761 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
762 #else
763 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
764 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
765 static char* __PYX_DEFAULT_STRING_ENCODING;
766 static int __Pyx_init_sys_getdefaultencoding_params(void) {
767  PyObject* sys;
768  PyObject* default_encoding = NULL;
769  char* default_encoding_c;
770  sys = PyImport_ImportModule("sys");
771  if (!sys) goto bad;
772  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
773  Py_DECREF(sys);
774  if (!default_encoding) goto bad;
775  default_encoding_c = PyBytes_AsString(default_encoding);
776  if (!default_encoding_c) goto bad;
777  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
778  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
779  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
780  Py_DECREF(default_encoding);
781  return 0;
782 bad:
783  Py_XDECREF(default_encoding);
784  return -1;
785 }
786 #endif
787 #endif
788 
789 
790 /* Test for GCC > 2.95 */
791 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
792  #define likely(x) __builtin_expect(!!(x), 1)
793  #define unlikely(x) __builtin_expect(!!(x), 0)
794 #else /* !__GNUC__ or GCC < 2.95 */
795  #define likely(x) (x)
796  #define unlikely(x) (x)
797 #endif /* __GNUC__ */
798 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
799 
800 static PyObject *__pyx_m = NULL;
801 static PyObject *__pyx_d;
802 static PyObject *__pyx_b;
803 static PyObject *__pyx_cython_runtime = NULL;
804 static PyObject *__pyx_empty_tuple;
805 static PyObject *__pyx_empty_bytes;
806 static PyObject *__pyx_empty_unicode;
807 static int __pyx_lineno;
808 static int __pyx_clineno = 0;
809 static const char * __pyx_cfilenm= __FILE__;
810 static const char *__pyx_filename;
811 
812 /* Header.proto */
813 #if !defined(CYTHON_CCOMPLEX)
814  #if defined(__cplusplus)
815  #define CYTHON_CCOMPLEX 1
816  #elif defined(_Complex_I)
817  #define CYTHON_CCOMPLEX 1
818  #else
819  #define CYTHON_CCOMPLEX 0
820  #endif
821 #endif
822 #if CYTHON_CCOMPLEX
823  #ifdef __cplusplus
824  #include <complex>
825  #else
826  #include <complex.h>
827  #endif
828 #endif
829 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
830  #undef _Complex_I
831  #define _Complex_I 1.0fj
832 #endif
833 
834 
835 static const char *__pyx_f[] = {
836  "proteus/superluWrappers.pyx",
837  "stringsource",
838  "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd",
839  "linux/lib/python3.7/site-packages/Cython/Includes/cpython/type.pxd",
840 };
841 /* MemviewSliceStruct.proto */
842 struct __pyx_memoryview_obj;
843 typedef struct {
844  struct __pyx_memoryview_obj *memview;
845  char *data;
846  Py_ssize_t shape[8];
847  Py_ssize_t strides[8];
848  Py_ssize_t suboffsets[8];
849 } __Pyx_memviewslice;
850 #define __Pyx_MemoryView_Len(m) (m.shape[0])
851 
852 /* Atomics.proto */
853 #include <pythread.h>
854 #ifndef CYTHON_ATOMICS
855  #define CYTHON_ATOMICS 1
856 #endif
857 #define __pyx_atomic_int_type int
858 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
859  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
860  !defined(__i386__)
861  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
862  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
863  #ifdef __PYX_DEBUG_ATOMICS
864  #warning "Using GNU atomics"
865  #endif
866 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
867  #include <Windows.h>
868  #undef __pyx_atomic_int_type
869  #define __pyx_atomic_int_type LONG
870  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
871  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
872  #ifdef __PYX_DEBUG_ATOMICS
873  #pragma message ("Using MSVC atomics")
874  #endif
875 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
876  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
877  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
878  #ifdef __PYX_DEBUG_ATOMICS
879  #warning "Using Intel atomics"
880  #endif
881 #else
882  #undef CYTHON_ATOMICS
883  #define CYTHON_ATOMICS 0
884  #ifdef __PYX_DEBUG_ATOMICS
885  #warning "Not using atomics"
886  #endif
887 #endif
888 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
889 #if CYTHON_ATOMICS
890  #define __pyx_add_acquisition_count(memview)\
891  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
892  #define __pyx_sub_acquisition_count(memview)\
893  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
894 #else
895  #define __pyx_add_acquisition_count(memview)\
896  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
897  #define __pyx_sub_acquisition_count(memview)\
898  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
899 #endif
900 
901 /* ForceInitThreads.proto */
902 #ifndef __PYX_FORCE_INIT_THREADS
903  #define __PYX_FORCE_INIT_THREADS 0
904 #endif
905 
906 /* NoFastGil.proto */
907 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
908 #define __Pyx_PyGILState_Release PyGILState_Release
909 #define __Pyx_FastGIL_Remember()
910 #define __Pyx_FastGIL_Forget()
911 #define __Pyx_FastGilFuncInit()
912 
913 /* BufferFormatStructs.proto */
914 #define IS_UNSIGNED(type) (((type) -1) > 0)
915 struct __Pyx_StructField_;
916 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
917 typedef struct {
918  const char* name;
919  struct __Pyx_StructField_* fields;
920  size_t size;
921  size_t arraysize[8];
922  int ndim;
923  char typegroup;
924  char is_unsigned;
925  int flags;
926 } __Pyx_TypeInfo;
927 typedef struct __Pyx_StructField_ {
928  __Pyx_TypeInfo* type;
929  const char* name;
930  size_t offset;
931 } __Pyx_StructField;
932 typedef struct {
933  __Pyx_StructField* field;
934  size_t parent_offset;
935 } __Pyx_BufFmt_StackElem;
936 typedef struct {
937  __Pyx_StructField root;
938  __Pyx_BufFmt_StackElem* head;
939  size_t fmt_offset;
940  size_t new_count, enc_count;
941  size_t struct_alignment;
942  int is_complex;
943  char enc_type;
944  char new_packmode;
945  char enc_packmode;
946  char is_valid_array;
947 } __Pyx_BufFmt_Context;
948 
949 
950 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
951  * # in Cython to enable them only on the right systems.
952  *
953  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
954  * ctypedef npy_int16 int16_t
955  * ctypedef npy_int32 int32_t
956  */
957 typedef npy_int8 __pyx_t_5numpy_int8_t;
958 
959 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
960  *
961  * ctypedef npy_int8 int8_t
962  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
963  * ctypedef npy_int32 int32_t
964  * ctypedef npy_int64 int64_t
965  */
966 typedef npy_int16 __pyx_t_5numpy_int16_t;
967 
968 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
969  * ctypedef npy_int8 int8_t
970  * ctypedef npy_int16 int16_t
971  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
972  * ctypedef npy_int64 int64_t
973  * #ctypedef npy_int96 int96_t
974  */
975 typedef npy_int32 __pyx_t_5numpy_int32_t;
976 
977 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
978  * ctypedef npy_int16 int16_t
979  * ctypedef npy_int32 int32_t
980  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
981  * #ctypedef npy_int96 int96_t
982  * #ctypedef npy_int128 int128_t
983  */
984 typedef npy_int64 __pyx_t_5numpy_int64_t;
985 
986 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
987  * #ctypedef npy_int128 int128_t
988  *
989  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
990  * ctypedef npy_uint16 uint16_t
991  * ctypedef npy_uint32 uint32_t
992  */
993 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
994 
995 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":784
996  *
997  * ctypedef npy_uint8 uint8_t
998  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
999  * ctypedef npy_uint32 uint32_t
1000  * ctypedef npy_uint64 uint64_t
1001  */
1002 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1003 
1004 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
1005  * ctypedef npy_uint8 uint8_t
1006  * ctypedef npy_uint16 uint16_t
1007  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1008  * ctypedef npy_uint64 uint64_t
1009  * #ctypedef npy_uint96 uint96_t
1010  */
1011 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1012 
1013 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":786
1014  * ctypedef npy_uint16 uint16_t
1015  * ctypedef npy_uint32 uint32_t
1016  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1017  * #ctypedef npy_uint96 uint96_t
1018  * #ctypedef npy_uint128 uint128_t
1019  */
1020 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1021 
1022 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
1023  * #ctypedef npy_uint128 uint128_t
1024  *
1025  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1026  * ctypedef npy_float64 float64_t
1027  * #ctypedef npy_float80 float80_t
1028  */
1029 typedef npy_float32 __pyx_t_5numpy_float32_t;
1030 
1031 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
1032  *
1033  * ctypedef npy_float32 float32_t
1034  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1035  * #ctypedef npy_float80 float80_t
1036  * #ctypedef npy_float128 float128_t
1037  */
1038 typedef npy_float64 __pyx_t_5numpy_float64_t;
1039 
1040 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":800
1041  * # The int types are mapped a bit surprising --
1042  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1043  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1044  * ctypedef npy_longlong long_t
1045  * ctypedef npy_longlong longlong_t
1046  */
1047 typedef npy_long __pyx_t_5numpy_int_t;
1048 
1049 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
1050  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1051  * ctypedef npy_long int_t
1052  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1053  * ctypedef npy_longlong longlong_t
1054  *
1055  */
1056 typedef npy_longlong __pyx_t_5numpy_long_t;
1057 
1058 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
1059  * ctypedef npy_long int_t
1060  * ctypedef npy_longlong long_t
1061  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1062  *
1063  * ctypedef npy_ulong uint_t
1064  */
1065 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1066 
1067 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":804
1068  * ctypedef npy_longlong longlong_t
1069  *
1070  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1071  * ctypedef npy_ulonglong ulong_t
1072  * ctypedef npy_ulonglong ulonglong_t
1073  */
1074 typedef npy_ulong __pyx_t_5numpy_uint_t;
1075 
1076 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":805
1077  *
1078  * ctypedef npy_ulong uint_t
1079  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1080  * ctypedef npy_ulonglong ulonglong_t
1081  *
1082  */
1083 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1084 
1085 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":806
1086  * ctypedef npy_ulong uint_t
1087  * ctypedef npy_ulonglong ulong_t
1088  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1089  *
1090  * ctypedef npy_intp intp_t
1091  */
1092 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1093 
1094 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":808
1095  * ctypedef npy_ulonglong ulonglong_t
1096  *
1097  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1098  * ctypedef npy_uintp uintp_t
1099  *
1100  */
1101 typedef npy_intp __pyx_t_5numpy_intp_t;
1102 
1103 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":809
1104  *
1105  * ctypedef npy_intp intp_t
1106  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1107  *
1108  * ctypedef npy_double float_t
1109  */
1110 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1111 
1112 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":811
1113  * ctypedef npy_uintp uintp_t
1114  *
1115  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1116  * ctypedef npy_double double_t
1117  * ctypedef npy_longdouble longdouble_t
1118  */
1119 typedef npy_double __pyx_t_5numpy_float_t;
1120 
1121 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
1122  *
1123  * ctypedef npy_double float_t
1124  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1125  * ctypedef npy_longdouble longdouble_t
1126  *
1127  */
1128 typedef npy_double __pyx_t_5numpy_double_t;
1129 
1130 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
1131  * ctypedef npy_double float_t
1132  * ctypedef npy_double double_t
1133  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1134  *
1135  * ctypedef npy_cfloat cfloat_t
1136  */
1137 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1138 /* Declarations.proto */
1139 #if CYTHON_CCOMPLEX
1140  #ifdef __cplusplus
1141  typedef ::std::complex< float > __pyx_t_float_complex;
1142  #else
1143  typedef float _Complex __pyx_t_float_complex;
1144  #endif
1145 #else
1146  typedef struct { float real, imag; } __pyx_t_float_complex;
1147 #endif
1148 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1149 
1150 /* Declarations.proto */
1151 #if CYTHON_CCOMPLEX
1152  #ifdef __cplusplus
1153  typedef ::std::complex< double > __pyx_t_double_complex;
1154  #else
1155  typedef double _Complex __pyx_t_double_complex;
1156  #endif
1157 #else
1158  typedef struct { double real, imag; } __pyx_t_double_complex;
1159 #endif
1160 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1161 
1162 
1163 /*--- Type declarations ---*/
1164 struct __pyx_obj_15superluWrappers_cSparseMatrix;
1165 struct __pyx_obj_15superluWrappers_SparseFactor;
1166 struct __pyx_array_obj;
1167 struct __pyx_MemviewEnum_obj;
1168 struct __pyx_memoryview_obj;
1169 struct __pyx_memoryviewslice_obj;
1170 
1171 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
1172  * ctypedef npy_longdouble longdouble_t
1173  *
1174  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1175  * ctypedef npy_cdouble cdouble_t
1176  * ctypedef npy_clongdouble clongdouble_t
1177  */
1178 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1179 
1180 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
1181  *
1182  * ctypedef npy_cfloat cfloat_t
1183  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1184  * ctypedef npy_clongdouble clongdouble_t
1185  *
1186  */
1187 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1188 
1189 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":817
1190  * ctypedef npy_cfloat cfloat_t
1191  * ctypedef npy_cdouble cdouble_t
1192  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1193  *
1194  * ctypedef npy_cdouble complex_t
1195  */
1196 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1197 
1198 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":819
1199  * ctypedef npy_clongdouble clongdouble_t
1200  *
1201  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1202  *
1203  * cdef inline object PyArray_MultiIterNew1(a):
1204  */
1205 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1206 struct __pyx_t_15superluWrappers__NRformat;
1207 struct __pyx_t_15superluWrappers__NCformat;
1208 struct __pyx_t_15superluWrappers__DNformat;
1209 struct __pyx_t_15superluWrappers__NCPformat;
1210 
1211 /* "superluWrappers.pxd":61
1212  * void csp_preorder "sp_preorder"(_superlu_options_t *, _SuperMatrix *, int *, int *, _SuperMatrix *)
1213  *
1214  * cdef struct _NRformat: # <<<<<<<<<<<<<<
1215  * np.int32_t nnz
1216  * np.float64_t * nzval
1217  */
1218 struct __pyx_t_15superluWrappers__NRformat {
1219  __pyx_t_5numpy_int32_t nnz;
1220  __pyx_t_5numpy_float64_t *nzval;
1221  __pyx_t_5numpy_int32_t *colind;
1222  __pyx_t_5numpy_int32_t *rowptr;
1223 };
1224 
1225 /* "superluWrappers.pyx":128
1226  * yp[i] = tmp
1227  *
1228  * cdef struct _NCformat: # <<<<<<<<<<<<<<
1229  * np.int32_t nnz
1230  * np.float64_t * nzval
1231  */
1232 struct __pyx_t_15superluWrappers__NCformat {
1233  __pyx_t_5numpy_int32_t nnz;
1234  __pyx_t_5numpy_float64_t *nzval;
1235  __pyx_t_5numpy_int32_t *rowind;
1236  __pyx_t_5numpy_int32_t *colptr;
1237 };
1238 
1239 /* "superluWrappers.pyx":134
1240  * np.int32_t * colptr
1241  *
1242  * cdef struct _DNformat: # <<<<<<<<<<<<<<
1243  * np.int32_t lda
1244  * void *nzval
1245  */
1246 struct __pyx_t_15superluWrappers__DNformat {
1247  __pyx_t_5numpy_int32_t lda;
1248  void *nzval;
1249 };
1250 
1251 /* "superluWrappers.pyx":138
1252  * void *nzval
1253  *
1254  * cdef struct _NCPformat: # <<<<<<<<<<<<<<
1255  * np.int32_t nnz
1256  * void * nzval
1257  */
1258 struct __pyx_t_15superluWrappers__NCPformat {
1259  __pyx_t_5numpy_int32_t nnz;
1260  void *nzval;
1261  __pyx_t_5numpy_int32_t *rowind;
1262  __pyx_t_5numpy_int32_t *colbeg;
1263  __pyx_t_5numpy_int32_t *colend;
1264 };
1265 
1266 /* "superluWrappers.pxd":67
1267  * np.int32_t * rowptr
1268  *
1269  * cdef class cSparseMatrix(object): # <<<<<<<<<<<<<<
1270  * cdef np.int32_t dim[2]
1271  * cdef _NRformat A
1272  */
1273 struct __pyx_obj_15superluWrappers_cSparseMatrix {
1274  PyObject_HEAD
1275  __pyx_t_5numpy_int32_t dim[2];
1276  struct __pyx_t_15superluWrappers__NRformat A;
1277 };
1278 
1279 
1280 /* "superluWrappers.pyx":145
1281  * np.int32_t * colend
1282  *
1283  * cdef class SparseFactor(object): # <<<<<<<<<<<<<<
1284  *
1285  * cdef _superlu_options_t options
1286  */
1287 struct __pyx_obj_15superluWrappers_SparseFactor {
1288  PyObject_HEAD
1289  struct __pyx_vtabstruct_15superluWrappers_SparseFactor *__pyx_vtab;
1290  superlu_options_t options;
1291  SuperMatrix A;
1292  SuperMatrix AC;
1293  SuperMatrix L;
1294  SuperMatrix U;
1295  SuperMatrix X;
1296  GlobalLU_t Glu;
1297  SuperLUStat_t stat;
1298  struct __pyx_t_15superluWrappers__NCformat storeA;
1299  struct __pyx_t_15superluWrappers__DNformat storeX;
1300  int *perm_c;
1301  int *perm_r;
1302  int *etree;
1303  unsigned int use_same_perm_c;
1304  unsigned int use_same_sparsity;
1305  int dim;
1306 };
1307 
1308 
1309 /* "View.MemoryView":105
1310  *
1311  * @cname("__pyx_array")
1312  * cdef class array: # <<<<<<<<<<<<<<
1313  *
1314  * cdef:
1315  */
1316 struct __pyx_array_obj {
1317  PyObject_HEAD
1318  struct __pyx_vtabstruct_array *__pyx_vtab;
1319  char *data;
1320  Py_ssize_t len;
1321  char *format;
1322  int ndim;
1323  Py_ssize_t *_shape;
1324  Py_ssize_t *_strides;
1325  Py_ssize_t itemsize;
1326  PyObject *mode;
1327  PyObject *_format;
1328  void (*callback_free_data)(void *);
1329  int free_data;
1330  int dtype_is_object;
1331 };
1332 
1333 
1334 /* "View.MemoryView":279
1335  *
1336  * @cname('__pyx_MemviewEnum')
1337  * cdef class Enum(object): # <<<<<<<<<<<<<<
1338  * cdef object name
1339  * def __init__(self, name):
1340  */
1341 struct __pyx_MemviewEnum_obj {
1342  PyObject_HEAD
1343  PyObject *name;
1344 };
1345 
1346 
1347 /* "View.MemoryView":330
1348  *
1349  * @cname('__pyx_memoryview')
1350  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1351  *
1352  * cdef object obj
1353  */
1354 struct __pyx_memoryview_obj {
1355  PyObject_HEAD
1356  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1357  PyObject *obj;
1358  PyObject *_size;
1359  PyObject *_array_interface;
1360  PyThread_type_lock lock;
1361  __pyx_atomic_int acquisition_count[2];
1362  __pyx_atomic_int *acquisition_count_aligned_p;
1363  Py_buffer view;
1364  int flags;
1365  int dtype_is_object;
1366  __Pyx_TypeInfo *typeinfo;
1367 };
1368 
1369 
1370 /* "View.MemoryView":965
1371  *
1372  * @cname('__pyx_memoryviewslice')
1373  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1374  * "Internal class for passing memoryview slices to Python"
1375  *
1376  */
1377 struct __pyx_memoryviewslice_obj {
1378  struct __pyx_memoryview_obj __pyx_base;
1379  __Pyx_memviewslice from_slice;
1380  PyObject *from_object;
1381  PyObject *(*to_object_func)(char *);
1382  int (*to_dtype_func)(char *, PyObject *);
1383 };
1384 
1385 
1386 
1387 /* "superluWrappers.pyx":145
1388  * np.int32_t * colend
1389  *
1390  * cdef class SparseFactor(object): # <<<<<<<<<<<<<<
1391  *
1392  * cdef _superlu_options_t options
1393  */
1394 
1395 struct __pyx_vtabstruct_15superluWrappers_SparseFactor {
1396  PyObject *(*_set_mat_types)(struct __pyx_obj_15superluWrappers_SparseFactor *);
1397 };
1398 static struct __pyx_vtabstruct_15superluWrappers_SparseFactor *__pyx_vtabptr_15superluWrappers_SparseFactor;
1399 
1400 
1401 /* "View.MemoryView":105
1402  *
1403  * @cname("__pyx_array")
1404  * cdef class array: # <<<<<<<<<<<<<<
1405  *
1406  * cdef:
1407  */
1408 
1409 struct __pyx_vtabstruct_array {
1410  PyObject *(*get_memview)(struct __pyx_array_obj *);
1411 };
1412 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1413 
1414 
1415 /* "View.MemoryView":330
1416  *
1417  * @cname('__pyx_memoryview')
1418  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1419  *
1420  * cdef object obj
1421  */
1422 
1423 struct __pyx_vtabstruct_memoryview {
1424  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1425  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1426  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1427  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1428  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1429  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1430  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1431 };
1432 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1433 
1434 
1435 /* "View.MemoryView":965
1436  *
1437  * @cname('__pyx_memoryviewslice')
1438  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1439  * "Internal class for passing memoryview slices to Python"
1440  *
1441  */
1442 
1443 struct __pyx_vtabstruct__memoryviewslice {
1444  struct __pyx_vtabstruct_memoryview __pyx_base;
1445 };
1446 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1447 
1448 /* --- Runtime support code (head) --- */
1449 /* Refnanny.proto */
1450 #ifndef CYTHON_REFNANNY
1451  #define CYTHON_REFNANNY 0
1452 #endif
1453 #if CYTHON_REFNANNY
1454  typedef struct {
1455  void (*INCREF)(void*, PyObject*, int);
1456  void (*DECREF)(void*, PyObject*, int);
1457  void (*GOTREF)(void*, PyObject*, int);
1458  void (*GIVEREF)(void*, PyObject*, int);
1459  void* (*SetupContext)(const char*, int, const char*);
1460  void (*FinishContext)(void**);
1461  } __Pyx_RefNannyAPIStruct;
1462  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1463  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1464  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1465 #ifdef WITH_THREAD
1466  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1467  if (acquire_gil) {\
1468  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1469  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1470  PyGILState_Release(__pyx_gilstate_save);\
1471  } else {\
1472  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1473  }
1474 #else
1475  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1476  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1477 #endif
1478  #define __Pyx_RefNannyFinishContext()\
1479  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1480  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1481  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1482  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1483  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1484  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1485  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1486  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1487  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1488 #else
1489  #define __Pyx_RefNannyDeclarations
1490  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1491  #define __Pyx_RefNannyFinishContext()
1492  #define __Pyx_INCREF(r) Py_INCREF(r)
1493  #define __Pyx_DECREF(r) Py_DECREF(r)
1494  #define __Pyx_GOTREF(r)
1495  #define __Pyx_GIVEREF(r)
1496  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1497  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1498  #define __Pyx_XGOTREF(r)
1499  #define __Pyx_XGIVEREF(r)
1500 #endif
1501 #define __Pyx_XDECREF_SET(r, v) do {\
1502  PyObject *tmp = (PyObject *) r;\
1503  r = v; __Pyx_XDECREF(tmp);\
1504  } while (0)
1505 #define __Pyx_DECREF_SET(r, v) do {\
1506  PyObject *tmp = (PyObject *) r;\
1507  r = v; __Pyx_DECREF(tmp);\
1508  } while (0)
1509 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1510 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1511 
1512 /* PyObjectGetAttrStr.proto */
1513 #if CYTHON_USE_TYPE_SLOTS
1514 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1515 #else
1516 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1517 #endif
1518 
1519 /* GetBuiltinName.proto */
1520 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1521 
1522 /* RaiseArgTupleInvalid.proto */
1523 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1524  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1525 
1526 /* RaiseDoubleKeywords.proto */
1527 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1528 
1529 /* ParseKeywords.proto */
1530 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1531  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1532  const char* function_name);
1533 
1534 /* PyObjectSetAttrStr.proto */
1535 #if CYTHON_USE_TYPE_SLOTS
1536 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1537 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1538 #else
1539 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1540 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1541 #endif
1542 
1543 /* PyObjectCall.proto */
1544 #if CYTHON_COMPILING_IN_CPYTHON
1545 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1546 #else
1547 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1548 #endif
1549 
1550 /* ExtTypeTest.proto */
1551 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1552 
1553 /* MemviewSliceInit.proto */
1554 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1555 #define __Pyx_MEMVIEW_DIRECT 1
1556 #define __Pyx_MEMVIEW_PTR 2
1557 #define __Pyx_MEMVIEW_FULL 4
1558 #define __Pyx_MEMVIEW_CONTIG 8
1559 #define __Pyx_MEMVIEW_STRIDED 16
1560 #define __Pyx_MEMVIEW_FOLLOW 32
1561 #define __Pyx_IS_C_CONTIG 1
1562 #define __Pyx_IS_F_CONTIG 2
1563 static int __Pyx_init_memviewslice(
1564  struct __pyx_memoryview_obj *memview,
1565  int ndim,
1566  __Pyx_memviewslice *memviewslice,
1567  int memview_is_new_reference);
1568 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1569  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1570 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1571  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1572 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1573 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1574 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1575 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1576 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1577 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1578 
1579 /* PyObjectLookupSpecial.proto */
1580 #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
1581 static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
1582  PyObject *res;
1583  PyTypeObject *tp = Py_TYPE(obj);
1584 #if PY_MAJOR_VERSION < 3
1585  if (unlikely(PyInstance_Check(obj)))
1586  return __Pyx_PyObject_GetAttrStr(obj, attr_name);
1587 #endif
1588  res = _PyType_Lookup(tp, attr_name);
1589  if (likely(res)) {
1590  descrgetfunc f = Py_TYPE(res)->tp_descr_get;
1591  if (!f) {
1592  Py_INCREF(res);
1593  } else {
1594  res = f(res, obj, (PyObject *)tp);
1595  }
1596  } else {
1597  PyErr_SetObject(PyExc_AttributeError, attr_name);
1598  }
1599  return res;
1600 }
1601 #else
1602 #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
1603 #endif
1604 
1605 /* PyFunctionFastCall.proto */
1606 #if CYTHON_FAST_PYCALL
1607 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1608  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1609 #if 1 || PY_VERSION_HEX < 0x030600B1
1610 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1611 #else
1612 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1613 #endif
1614 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1615  (sizeof(char [1 - 2*!(cond)]) - 1)
1616 #ifndef Py_MEMBER_SIZE
1617 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1618 #endif
1619  static size_t __pyx_pyframe_localsplus_offset = 0;
1620  #include "frameobject.h"
1621  #define __Pxy_PyFrame_Initialize_Offsets()\
1622  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1623  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1624  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1625  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1626 #endif
1627 
1628 /* PyObjectCallMethO.proto */
1629 #if CYTHON_COMPILING_IN_CPYTHON
1630 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1631 #endif
1632 
1633 /* PyObjectCallNoArg.proto */
1634 #if CYTHON_COMPILING_IN_CPYTHON
1635 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1636 #else
1637 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1638 #endif
1639 
1640 /* PyCFunctionFastCall.proto */
1641 #if CYTHON_FAST_PYCCALL
1642 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1643 #else
1644 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1645 #endif
1646 
1647 /* PyObjectCallOneArg.proto */
1648 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1649 
1650 /* GetItemInt.proto */
1651 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1652  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1653  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1654  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1655  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1656 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1657  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1658  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1659  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1660 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1661  int wraparound, int boundscheck);
1662 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1663  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1664  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1665  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1666 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1667  int wraparound, int boundscheck);
1668 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1669 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1670  int is_list, int wraparound, int boundscheck);
1671 
1672 /* ObjectGetItem.proto */
1673 #if CYTHON_USE_TYPE_SLOTS
1674 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1675 #else
1676 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1677 #endif
1678 
1679 /* PyObjectCall2Args.proto */
1680 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1681 
1682 /* PyIntBinop.proto */
1683 #if !CYTHON_COMPILING_IN_PYPY
1684 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1685 #else
1686 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1687  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1688 #endif
1689 
1690 /* GetTopmostException.proto */
1691 #if CYTHON_USE_EXC_INFO_STACK
1692 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1693 #endif
1694 
1695 /* PyThreadStateGet.proto */
1696 #if CYTHON_FAST_THREAD_STATE
1697 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1698 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1699 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1700 #else
1701 #define __Pyx_PyThreadState_declare
1702 #define __Pyx_PyThreadState_assign
1703 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1704 #endif
1705 
1706 /* SaveResetException.proto */
1707 #if CYTHON_FAST_THREAD_STATE
1708 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1709 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1710 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1711 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1712 #else
1713 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1714 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1715 #endif
1716 
1717 /* GetException.proto */
1718 #if CYTHON_FAST_THREAD_STATE
1719 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1720 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1721 #else
1722 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1723 #endif
1724 
1725 /* PyErrFetchRestore.proto */
1726 #if CYTHON_FAST_THREAD_STATE
1727 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1728 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1729 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1730 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1731 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1732 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1733 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1734 #if CYTHON_COMPILING_IN_CPYTHON
1735 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1736 #else
1737 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1738 #endif
1739 #else
1740 #define __Pyx_PyErr_Clear() PyErr_Clear()
1741 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1742 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1743 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1744 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1745 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1746 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1747 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1748 #endif
1749 
1750 /* SliceObject.proto */
1751 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
1752  PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
1753  PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1754  int has_cstart, int has_cstop, int wraparound);
1755 
1756 /* RaiseException.proto */
1757 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1758 
1759 /* WriteUnraisableException.proto */
1760 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1761  int lineno, const char *filename,
1762  int full_traceback, int nogil);
1763 
1764 /* DictGetItem.proto */
1765 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1766 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1767 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1768  (likely(PyDict_CheckExact(obj)) ?\
1769  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1770 #else
1771 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1772 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1773 #endif
1774 
1775 /* RaiseTooManyValuesToUnpack.proto */
1776 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1777 
1778 /* RaiseNeedMoreValuesToUnpack.proto */
1779 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1780 
1781 /* RaiseNoneIterError.proto */
1782 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1783 
1784 /* PyErrExceptionMatches.proto */
1785 #if CYTHON_FAST_THREAD_STATE
1786 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1787 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1788 #else
1789 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1790 #endif
1791 
1792 /* ArgTypeTest.proto */
1793 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1794  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1795  __Pyx__ArgTypeTest(obj, type, name, exact))
1796 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1797 
1798 /* IncludeStringH.proto */
1799 #include <string.h>
1800 
1801 /* BytesEquals.proto */
1802 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1803 
1804 /* UnicodeEquals.proto */
1805 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1806 
1807 /* StrEquals.proto */
1808 #if PY_MAJOR_VERSION >= 3
1809 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1810 #else
1811 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1812 #endif
1813 
1814 /* None.proto */
1815 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1816 
1817 /* UnaryNegOverflows.proto */
1818 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1819  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1820 
1821 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1822 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1823 /* GetAttr.proto */
1824 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1825 
1826 /* decode_c_string_utf16.proto */
1827 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1828  int byteorder = 0;
1829  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1830 }
1831 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1832  int byteorder = -1;
1833  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1834 }
1835 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1836  int byteorder = 1;
1837  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1838 }
1839 
1840 /* decode_c_string.proto */
1841 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1842  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1843  const char* encoding, const char* errors,
1844  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1845 
1846 /* GetAttr3.proto */
1847 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1848 
1849 /* PyDictVersioning.proto */
1850 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1851 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1852 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1853 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1854  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1855  (cache_var) = (value);
1856 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1857  static PY_UINT64_T __pyx_dict_version = 0;\
1858  static PyObject *__pyx_dict_cached_value = NULL;\
1859  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1860  (VAR) = __pyx_dict_cached_value;\
1861  } else {\
1862  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1863  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1864  }\
1865 }
1866 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1867 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1868 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1869 #else
1870 #define __PYX_GET_DICT_VERSION(dict) (0)
1871 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1872 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1873 #endif
1874 
1875 /* GetModuleGlobalName.proto */
1876 #if CYTHON_USE_DICT_VERSIONS
1877 #define __Pyx_GetModuleGlobalName(var, name) {\
1878  static PY_UINT64_T __pyx_dict_version = 0;\
1879  static PyObject *__pyx_dict_cached_value = NULL;\
1880  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1881  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1882  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1883 }
1884 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1885  PY_UINT64_T __pyx_dict_version;\
1886  PyObject *__pyx_dict_cached_value;\
1887  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1888 }
1889 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1890 #else
1891 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1892 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1893 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1894 #endif
1895 
1896 /* SwapException.proto */
1897 #if CYTHON_FAST_THREAD_STATE
1898 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1899 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1900 #else
1901 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1902 #endif
1903 
1904 /* Import.proto */
1905 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1906 
1907 /* FastTypeChecks.proto */
1908 #if CYTHON_COMPILING_IN_CPYTHON
1909 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1910 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1911 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1912 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1913 #else
1914 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1915 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1916 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1917 #endif
1918 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1919 
1920 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1921 /* ListCompAppend.proto */
1922 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1923 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1924  PyListObject* L = (PyListObject*) list;
1925  Py_ssize_t len = Py_SIZE(list);
1926  if (likely(L->allocated > len)) {
1927  Py_INCREF(x);
1928  PyList_SET_ITEM(list, len, x);
1929  Py_SIZE(list) = len+1;
1930  return 0;
1931  }
1932  return PyList_Append(list, x);
1933 }
1934 #else
1935 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1936 #endif
1937 
1938 /* ListExtend.proto */
1939 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1940 #if CYTHON_COMPILING_IN_CPYTHON
1941  PyObject* none = _PyList_Extend((PyListObject*)L, v);
1942  if (unlikely(!none))
1943  return -1;
1944  Py_DECREF(none);
1945  return 0;
1946 #else
1947  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1948 #endif
1949 }
1950 
1951 /* ListAppend.proto */
1952 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1953 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1954  PyListObject* L = (PyListObject*) list;
1955  Py_ssize_t len = Py_SIZE(list);
1956  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1957  Py_INCREF(x);
1958  PyList_SET_ITEM(list, len, x);
1959  Py_SIZE(list) = len+1;
1960  return 0;
1961  }
1962  return PyList_Append(list, x);
1963 }
1964 #else
1965 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1966 #endif
1967 
1968 /* None.proto */
1969 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
1970 
1971 /* None.proto */
1972 static CYTHON_INLINE long __Pyx_div_long(long, long);
1973 
1974 /* ImportFrom.proto */
1975 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1976 
1977 /* HasAttr.proto */
1978 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1979 
1980 /* PyObject_GenericGetAttrNoDict.proto */
1981 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1982 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1983 #else
1984 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1985 #endif
1986 
1987 /* PyObject_GenericGetAttr.proto */
1988 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1989 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1990 #else
1991 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1992 #endif
1993 
1994 /* SetupReduce.proto */
1995 static int __Pyx_setup_reduce(PyObject* type_obj);
1996 
1997 /* SetVTable.proto */
1998 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1999 
2000 /* TypeImport.proto */
2001 #ifndef __PYX_HAVE_RT_ImportType_proto
2002 #define __PYX_HAVE_RT_ImportType_proto
2003 enum __Pyx_ImportType_CheckSize {
2004  __Pyx_ImportType_CheckSize_Error = 0,
2005  __Pyx_ImportType_CheckSize_Warn = 1,
2006  __Pyx_ImportType_CheckSize_Ignore = 2
2007 };
2008 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2009 #endif
2010 
2011 /* CalculateMetaclass.proto */
2012 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
2013 
2014 /* FetchCommonType.proto */
2015 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2016 
2017 /* CythonFunction.proto */
2018 #define __Pyx_CyFunction_USED 1
2019 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2020 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2021 #define __Pyx_CYFUNCTION_CCLASS 0x04
2022 #define __Pyx_CyFunction_GetClosure(f)\
2023  (((__pyx_CyFunctionObject *) (f))->func_closure)
2024 #define __Pyx_CyFunction_GetClassObj(f)\
2025  (((__pyx_CyFunctionObject *) (f))->func_classobj)
2026 #define __Pyx_CyFunction_Defaults(type, f)\
2027  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2028 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2029  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2030 typedef struct {
2031  PyCFunctionObject func;
2032 #if PY_VERSION_HEX < 0x030500A0
2033  PyObject *func_weakreflist;
2034 #endif
2035  PyObject *func_dict;
2036  PyObject *func_name;
2037  PyObject *func_qualname;
2038  PyObject *func_doc;
2039  PyObject *func_globals;
2040  PyObject *func_code;
2041  PyObject *func_closure;
2042  PyObject *func_classobj;
2043  void *defaults;
2044  int defaults_pyobjects;
2045  size_t defaults_size; // used by FusedFunction for copying defaults
2046  int flags;
2047  PyObject *defaults_tuple;
2048  PyObject *defaults_kwdict;
2049  PyObject *(*defaults_getter)(PyObject *);
2050  PyObject *func_annotations;
2051 } __pyx_CyFunctionObject;
2052 static PyTypeObject *__pyx_CyFunctionType = 0;
2053 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2054 #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
2055  __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
2056 static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
2057  int flags, PyObject* qualname,
2058  PyObject *self,
2059  PyObject *module, PyObject *globals,
2060  PyObject* code);
2061 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2062  size_t size,
2063  int pyobjects);
2064 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2065  PyObject *tuple);
2066 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2067  PyObject *dict);
2068 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2069  PyObject *dict);
2070 static int __pyx_CyFunction_init(void);
2071 
2072 /* SetNameInClass.proto */
2073 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
2074 #define __Pyx_SetNameInClass(ns, name, value)\
2075  (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
2076 #elif CYTHON_COMPILING_IN_CPYTHON
2077 #define __Pyx_SetNameInClass(ns, name, value)\
2078  (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
2079 #else
2080 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
2081 #endif
2082 
2083 /* Py3ClassCreate.proto */
2084 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
2085  PyObject *mkw, PyObject *modname, PyObject *doc);
2086 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
2087  PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
2088 
2089 /* CLineInTraceback.proto */
2090 #ifdef CYTHON_CLINE_IN_TRACEBACK
2091 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2092 #else
2093 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2094 #endif
2095 
2096 /* CodeObjectCache.proto */
2097 typedef struct {
2098  PyCodeObject* code_object;
2099  int code_line;
2100 } __Pyx_CodeObjectCacheEntry;
2101 struct __Pyx_CodeObjectCache {
2102  int count;
2103  int max_count;
2104  __Pyx_CodeObjectCacheEntry* entries;
2105 };
2106 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2107 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2108 static PyCodeObject *__pyx_find_code_object(int code_line);
2109 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2110 
2111 /* AddTraceback.proto */
2112 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2113  int py_line, const char *filename);
2114 
2115 #if PY_MAJOR_VERSION < 3
2116  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2117  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2118 #else
2119  #define __Pyx_GetBuffer PyObject_GetBuffer
2120  #define __Pyx_ReleaseBuffer PyBuffer_Release
2121 #endif
2122 
2123 
2124 /* BufferStructDeclare.proto */
2125 typedef struct {
2126  Py_ssize_t shape, strides, suboffsets;
2127 } __Pyx_Buf_DimInfo;
2128 typedef struct {
2129  size_t refcount;
2130  Py_buffer pybuffer;
2131 } __Pyx_Buffer;
2132 typedef struct {
2133  __Pyx_Buffer *rcbuffer;
2134  char *data;
2135  __Pyx_Buf_DimInfo diminfo[8];
2136 } __Pyx_LocalBuf_ND;
2137 
2138 /* MemviewSliceIsContig.proto */
2139 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2140 
2141 /* OverlappingSlices.proto */
2142 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2143  __Pyx_memviewslice *slice2,
2144  int ndim, size_t itemsize);
2145 
2146 /* Capsule.proto */
2147 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2148 
2149 /* IsLittleEndian.proto */
2150 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2151 
2152 /* BufferFormatCheck.proto */
2153 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2154 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2155  __Pyx_BufFmt_StackElem* stack,
2156  __Pyx_TypeInfo* type);
2157 
2158 /* TypeInfoCompare.proto */
2159 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2160 
2161 /* MemviewSliceValidateAndInit.proto */
2162 static int __Pyx_ValidateAndInit_memviewslice(
2163  int *axes_specs,
2164  int c_or_f_flag,
2165  int buf_flags,
2166  int ndim,
2167  __Pyx_TypeInfo *dtype,
2168  __Pyx_BufFmt_StackElem stack[],
2169  __Pyx_memviewslice *memviewslice,
2170  PyObject *original_obj);
2171 
2172 /* ObjectToMemviewSlice.proto */
2173 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *, int writable_flag);
2174 
2175 /* ObjectToMemviewSlice.proto */
2176 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *, int writable_flag);
2177 
2178 /* CIntToPy.proto */
2179 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);
2180 
2181 /* CIntToPy.proto */
2182 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2183 
2184 /* RealImag.proto */
2185 #if CYTHON_CCOMPLEX
2186  #ifdef __cplusplus
2187  #define __Pyx_CREAL(z) ((z).real())
2188  #define __Pyx_CIMAG(z) ((z).imag())
2189  #else
2190  #define __Pyx_CREAL(z) (__real__(z))
2191  #define __Pyx_CIMAG(z) (__imag__(z))
2192  #endif
2193 #else
2194  #define __Pyx_CREAL(z) ((z).real)
2195  #define __Pyx_CIMAG(z) ((z).imag)
2196 #endif
2197 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2198  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2199  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2200  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2201 #else
2202  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2203  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2204 #endif
2205 
2206 /* Arithmetic.proto */
2207 #if CYTHON_CCOMPLEX
2208  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2209  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2210  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2211  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2212  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2213  #define __Pyx_c_neg_float(a) (-(a))
2214  #ifdef __cplusplus
2215  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2216  #define __Pyx_c_conj_float(z) (::std::conj(z))
2217  #if 1
2218  #define __Pyx_c_abs_float(z) (::std::abs(z))
2219  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2220  #endif
2221  #else
2222  #define __Pyx_c_is_zero_float(z) ((z)==0)
2223  #define __Pyx_c_conj_float(z) (conjf(z))
2224  #if 1
2225  #define __Pyx_c_abs_float(z) (cabsf(z))
2226  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2227  #endif
2228  #endif
2229 #else
2230  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2231  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2232  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2233  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2234  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2235  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2236  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2237  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2238  #if 1
2239  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2240  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2241  #endif
2242 #endif
2243 
2244 /* Arithmetic.proto */
2245 #if CYTHON_CCOMPLEX
2246  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2247  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2248  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2249  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2250  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2251  #define __Pyx_c_neg_double(a) (-(a))
2252  #ifdef __cplusplus
2253  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2254  #define __Pyx_c_conj_double(z) (::std::conj(z))
2255  #if 1
2256  #define __Pyx_c_abs_double(z) (::std::abs(z))
2257  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2258  #endif
2259  #else
2260  #define __Pyx_c_is_zero_double(z) ((z)==0)
2261  #define __Pyx_c_conj_double(z) (conj(z))
2262  #if 1
2263  #define __Pyx_c_abs_double(z) (cabs(z))
2264  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2265  #endif
2266  #endif
2267 #else
2268  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2269  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2270  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2271  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2272  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2273  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2274  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2275  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2276  #if 1
2277  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2278  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2279  #endif
2280 #endif
2281 
2282 /* CIntToPy.proto */
2283 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
2284 
2285 /* MemviewSliceCopyTemplate.proto */
2286 static __Pyx_memviewslice
2287 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2288  const char *mode, int ndim,
2289  size_t sizeof_dtype, int contig_flag,
2290  int dtype_is_object);
2291 
2292 /* CIntFromPy.proto */
2293 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2294 
2295 /* CIntFromPy.proto */
2296 static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
2297 
2298 /* CIntFromPy.proto */
2299 static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
2300 
2301 /* CIntFromPy.proto */
2302 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2303 
2304 /* CIntToPy.proto */
2305 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2306 
2307 /* CIntFromPy.proto */
2308 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2309 
2310 /* CheckBinaryVersion.proto */
2311 static int __Pyx_check_binary_version(void);
2312 
2313 /* InitStrings.proto */
2314 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2315 
2316 static PyObject *__pyx_f_15superluWrappers_12SparseFactor__set_mat_types(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self); /* proto*/
2317 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2318 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2319 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2320 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2321 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2322 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2323 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2324 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2325 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2326 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2327 
2328 /* Module declarations from 'cpython.buffer' */
2329 
2330 /* Module declarations from 'libc.string' */
2331 
2332 /* Module declarations from 'libc.stdio' */
2333 
2334 /* Module declarations from '__builtin__' */
2335 
2336 /* Module declarations from 'cpython.type' */
2337 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2338 
2339 /* Module declarations from 'cpython' */
2340 
2341 /* Module declarations from 'cpython.object' */
2342 
2343 /* Module declarations from 'cpython.ref' */
2344 
2345 /* Module declarations from 'cpython.mem' */
2346 
2347 /* Module declarations from 'numpy' */
2348 
2349 /* Module declarations from 'numpy' */
2350 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2351 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2352 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2353 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2354 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2355 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
2356 
2357 /* Module declarations from 'cython.view' */
2358 
2359 /* Module declarations from 'cython' */
2360 
2361 /* Module declarations from 'libc.stdlib' */
2362 
2363 /* Module declarations from 'superluWrappers' */
2364 static PyTypeObject *__pyx_ptype_15superluWrappers_cSparseMatrix = 0;
2365 static PyTypeObject *__pyx_ptype_15superluWrappers_SparseFactor = 0;
2366 static PyTypeObject *__pyx_array_type = 0;
2367 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2368 static PyTypeObject *__pyx_memoryview_type = 0;
2369 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2370 static PyObject *generic = 0;
2371 static PyObject *strided = 0;
2372 static PyObject *indirect = 0;
2373 static PyObject *contiguous = 0;
2374 static PyObject *indirect_contiguous = 0;
2375 static int __pyx_memoryview_thread_locks_used;
2376 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2377 static void __pyx_f_15superluWrappers_SparseMatrix_matvec(struct __pyx_obj_15superluWrappers_cSparseMatrix *, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
2378 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(struct __pyx_obj_15superluWrappers_cSparseMatrix *, struct __pyx_obj_15superluWrappers_SparseFactor *); /*proto*/
2379 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(struct __pyx_obj_15superluWrappers_SparseFactor *, __Pyx_memviewslice); /*proto*/
2380 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2381 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2382 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2383 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2384 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2385 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2386 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2387 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2388 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2389 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2390 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2391 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2392 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2393 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2394 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2395 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2396 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2397 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2398 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2399 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2400 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2401 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2402 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2403 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2404 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2405 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2406 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2407 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2408 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2409 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2410 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2411 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2412 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2413 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
2414 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 };
2415 #define __Pyx_MODULE_NAME "superluWrappers"
2416 extern int __pyx_module_is_main_superluWrappers;
2417 int __pyx_module_is_main_superluWrappers = 0;
2418 
2419 /* Implementation of 'superluWrappers' */
2420 static PyObject *__pyx_builtin_object;
2421 static PyObject *__pyx_builtin_open;
2422 static PyObject *__pyx_builtin_range;
2423 static PyObject *__pyx_builtin_TypeError;
2424 static PyObject *__pyx_builtin_ValueError;
2425 static PyObject *__pyx_builtin_RuntimeError;
2426 static PyObject *__pyx_builtin_ImportError;
2427 static PyObject *__pyx_builtin_MemoryError;
2428 static PyObject *__pyx_builtin_enumerate;
2429 static PyObject *__pyx_builtin_Ellipsis;
2430 static PyObject *__pyx_builtin_id;
2431 static PyObject *__pyx_builtin_IndexError;
2432 static const char __pyx_k_O[] = "O";
2433 static const char __pyx_k_c[] = "c";
2434 static const char __pyx_k_i[] = "i";
2435 static const char __pyx_k_k[] = "k";
2436 static const char __pyx_k_w[] = "w";
2437 static const char __pyx_k_x[] = "x";
2438 static const char __pyx_k_y[] = "y";
2439 static const char __pyx_k_id[] = "id";
2440 static const char __pyx_k_nc[] = "nc";
2441 static const char __pyx_k_np[] = "np";
2442 static const char __pyx_k_nr[] = "nr";
2443 static const char __pyx_k_dim[] = "dim";
2444 static const char __pyx_k_doc[] = "__doc__";
2445 static const char __pyx_k_new[] = "__new__";
2446 static const char __pyx_k_nnz[] = "nnz";
2447 static const char __pyx_k_obj[] = "obj";
2448 static const char __pyx_k_base[] = "base";
2449 static const char __pyx_k_dict[] = "__dict__";
2450 static const char __pyx_k_exit[] = "__exit__";
2451 static const char __pyx_k_init[] = "__init__";
2452 static const char __pyx_k_main[] = "__main__";
2453 static const char __pyx_k_mode[] = "mode";
2454 static const char __pyx_k_name[] = "name";
2455 static const char __pyx_k_ndim[] = "ndim";
2456 static const char __pyx_k_open[] = "open";
2457 static const char __pyx_k_pack[] = "pack";
2458 static const char __pyx_k_rows[] = "_rows";
2459 static const char __pyx_k_self[] = "self";
2460 static const char __pyx_k_size[] = "size";
2461 static const char __pyx_k_step[] = "step";
2462 static const char __pyx_k_stop[] = "stop";
2463 static const char __pyx_k_test[] = "__test__";
2464 static const char __pyx_k_ASCII[] = "ASCII";
2465 static const char __pyx_k_class[] = "__class__";
2466 static const char __pyx_k_enter[] = "__enter__";
2467 static const char __pyx_k_error[] = "error";
2468 static const char __pyx_k_flags[] = "flags";
2469 static const char __pyx_k_i_i_i[] = "%i %i %i \n";
2470 static const char __pyx_k_numpy[] = "numpy";
2471 static const char __pyx_k_nzval[] = "nzval";
2472 static const char __pyx_k_range[] = "range";
2473 static const char __pyx_k_shape[] = "shape";
2474 static const char __pyx_k_start[] = "start";
2475 static const char __pyx_k_write[] = "write";
2476 static const char __pyx_k_colind[] = "colind";
2477 static const char __pyx_k_encode[] = "encode";
2478 static const char __pyx_k_format[] = "format";
2479 static const char __pyx_k_fwrite[] = "fwrite";
2480 static const char __pyx_k_import[] = "__import__";
2481 static const char __pyx_k_matvec[] = "matvec";
2482 static const char __pyx_k_module[] = "__module__";
2483 static const char __pyx_k_name_2[] = "__name__";
2484 static const char __pyx_k_nzvals[] = "nzvals";
2485 static const char __pyx_k_object[] = "object";
2486 static const char __pyx_k_pickle[] = "pickle";
2487 static const char __pyx_k_reduce[] = "__reduce__";
2488 static const char __pyx_k_rowptr[] = "rowptr";
2489 static const char __pyx_k_struct[] = "struct";
2490 static const char __pyx_k_unpack[] = "unpack";
2491 static const char __pyx_k_update[] = "update";
2492 static const char __pyx_k_fortran[] = "fortran";
2493 static const char __pyx_k_memview[] = "memview";
2494 static const char __pyx_k_prepare[] = "__prepare__";
2495 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2496 static const char __pyx_k_filename[] = "filename";
2497 static const char __pyx_k_getstate[] = "__getstate__";
2498 static const char __pyx_k_itemsize[] = "itemsize";
2499 static const char __pyx_k_pyx_type[] = "__pyx_type";
2500 static const char __pyx_k_qualname[] = "__qualname__";
2501 static const char __pyx_k_setstate[] = "__setstate__";
2502 static const char __pyx_k_TypeError[] = "TypeError";
2503 static const char __pyx_k_d_d_13_8e[] = "%d %d %13.8e\n";
2504 static const char __pyx_k_enumerate[] = "enumerate";
2505 static const char __pyx_k_metaclass[] = "__metaclass__";
2506 static const char __pyx_k_pyx_state[] = "__pyx_state";
2507 static const char __pyx_k_range_end[] = "range_end";
2508 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2509 static const char __pyx_k_IndexError[] = "IndexError";
2510 static const char __pyx_k_ValueError[] = "ValueError";
2511 static const char __pyx_k_pyx_result[] = "__pyx_result";
2512 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2513 static const char __pyx_k_ImportError[] = "ImportError";
2514 static const char __pyx_k_MemoryError[] = "MemoryError";
2515 static const char __pyx_k_PickleError[] = "PickleError";
2516 static const char __pyx_k_output_file[] = "output_file";
2517 static const char __pyx_k_range_start[] = "range_start";
2518 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2519 static const char __pyx_k_SparseFactor[] = "SparseFactor";
2520 static const char __pyx_k_SparseMatrix[] = "SparseMatrix";
2521 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2522 static const char __pyx_k_sparseFactor[] = "sparseFactor";
2523 static const char __pyx_k_stringsource[] = "stringsource";
2524 static const char __pyx_k_cSparseMatrix[] = "_cSparseMatrix";
2525 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2526 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2527 static const char __pyx_k_sparse_matrix[] = "sparse_matrix";
2528 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2529 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2530 static const char __pyx_k_cSparseMatrix_2[] = "cSparseMatrix";
2531 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2532 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2533 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2534 static const char __pyx_k_superluWrappers[] = "superluWrappers";
2535 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2536 static const char __pyx_k_sparseFactorSolve[] = "sparseFactorSolve";
2537 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2538 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2539 static const char __pyx_k_SparseMatrix___init[] = "SparseMatrix.__init__";
2540 static const char __pyx_k_SparseMatrix_fwrite[] = "SparseMatrix.fwrite";
2541 static const char __pyx_k_SparseMatrix_matvec[] = "SparseMatrix.matvec";
2542 static const char __pyx_k_sparseFactorPrepare[] = "sparseFactorPrepare";
2543 static const char __pyx_k_getCSRrepresentation[] = "getCSRrepresentation";
2544 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2545 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2546 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2547 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2548 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2549 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2550 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2551 static const char __pyx_k_getSubMatCSRrepresentation[] = "getSubMatCSRrepresentation";
2552 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2553 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
2554 static const char __pyx_k_proteus_superluWrappers_pyx[] = "proteus/superluWrappers.pyx";
2555 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2556 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2557 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2558 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
2559 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2560 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2561 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2562 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2563 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2564 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
2565 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2566 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2567 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2568 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
2569 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2570 static const char __pyx_k_SparseMatrix_getCSRrepresentatio[] = "SparseMatrix.getCSRrepresentation";
2571 static const char __pyx_k_SparseMatrix_getSubMatCSRreprese[] = "SparseMatrix.getSubMatCSRrepresentation";
2572 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2573 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2574 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
2575 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2576 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2577 static const char __pyx_k_self_A_self_AC_self_L_self_U_sel[] = "self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling";
2578 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2579 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
2580 static PyObject *__pyx_n_s_ASCII;
2581 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2582 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2583 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2584 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2585 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2586 static PyObject *__pyx_n_s_Ellipsis;
2587 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2588 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2589 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2590 static PyObject *__pyx_n_s_ImportError;
2591 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2592 static PyObject *__pyx_n_s_IndexError;
2593 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2594 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2595 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2596 static PyObject *__pyx_n_s_MemoryError;
2597 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2598 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2599 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2600 static PyObject *__pyx_n_b_O;
2601 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2602 static PyObject *__pyx_n_s_PickleError;
2603 static PyObject *__pyx_n_s_RuntimeError;
2604 static PyObject *__pyx_n_s_SparseFactor;
2605 static PyObject *__pyx_n_s_SparseMatrix;
2606 static PyObject *__pyx_n_s_SparseMatrix___init;
2607 static PyObject *__pyx_n_s_SparseMatrix_fwrite;
2608 static PyObject *__pyx_n_s_SparseMatrix_getCSRrepresentatio;
2609 static PyObject *__pyx_n_s_SparseMatrix_getSubMatCSRreprese;
2610 static PyObject *__pyx_n_s_SparseMatrix_matvec;
2611 static PyObject *__pyx_n_s_TypeError;
2612 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2613 static PyObject *__pyx_n_s_ValueError;
2614 static PyObject *__pyx_n_s_View_MemoryView;
2615 static PyObject *__pyx_n_s_allocate_buffer;
2616 static PyObject *__pyx_n_s_base;
2617 static PyObject *__pyx_n_s_c;
2618 static PyObject *__pyx_n_u_c;
2619 static PyObject *__pyx_n_s_cSparseMatrix;
2620 static PyObject *__pyx_n_s_cSparseMatrix_2;
2621 static PyObject *__pyx_n_s_class;
2622 static PyObject *__pyx_n_s_cline_in_traceback;
2623 static PyObject *__pyx_n_s_colind;
2624 static PyObject *__pyx_kp_s_contiguous_and_direct;
2625 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2626 static PyObject *__pyx_kp_s_d_d_13_8e;
2627 static PyObject *__pyx_n_s_dict;
2628 static PyObject *__pyx_n_s_dim;
2629 static PyObject *__pyx_n_s_doc;
2630 static PyObject *__pyx_n_s_dtype_is_object;
2631 static PyObject *__pyx_n_s_encode;
2632 static PyObject *__pyx_n_s_enter;
2633 static PyObject *__pyx_n_s_enumerate;
2634 static PyObject *__pyx_n_s_error;
2635 static PyObject *__pyx_n_s_exit;
2636 static PyObject *__pyx_n_s_filename;
2637 static PyObject *__pyx_n_s_flags;
2638 static PyObject *__pyx_n_s_format;
2639 static PyObject *__pyx_n_s_fortran;
2640 static PyObject *__pyx_n_u_fortran;
2641 static PyObject *__pyx_n_s_fwrite;
2642 static PyObject *__pyx_n_s_getCSRrepresentation;
2643 static PyObject *__pyx_n_s_getSubMatCSRrepresentation;
2644 static PyObject *__pyx_n_s_getstate;
2645 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2646 static PyObject *__pyx_n_s_i;
2647 static PyObject *__pyx_kp_s_i_i_i;
2648 static PyObject *__pyx_n_s_id;
2649 static PyObject *__pyx_n_s_import;
2650 static PyObject *__pyx_n_s_init;
2651 static PyObject *__pyx_n_s_itemsize;
2652 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2653 static PyObject *__pyx_n_s_k;
2654 static PyObject *__pyx_n_s_main;
2655 static PyObject *__pyx_n_s_matvec;
2656 static PyObject *__pyx_n_s_memview;
2657 static PyObject *__pyx_n_s_metaclass;
2658 static PyObject *__pyx_n_s_mode;
2659 static PyObject *__pyx_n_s_module;
2660 static PyObject *__pyx_n_s_name;
2661 static PyObject *__pyx_n_s_name_2;
2662 static PyObject *__pyx_n_s_nc;
2663 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2664 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2665 static PyObject *__pyx_n_s_ndim;
2666 static PyObject *__pyx_n_s_new;
2667 static PyObject *__pyx_n_s_nnz;
2668 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2669 static PyObject *__pyx_n_s_np;
2670 static PyObject *__pyx_n_s_nr;
2671 static PyObject *__pyx_n_s_numpy;
2672 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2673 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2674 static PyObject *__pyx_n_s_nzval;
2675 static PyObject *__pyx_n_s_nzvals;
2676 static PyObject *__pyx_n_s_obj;
2677 static PyObject *__pyx_n_s_object;
2678 static PyObject *__pyx_n_s_open;
2679 static PyObject *__pyx_n_s_output_file;
2680 static PyObject *__pyx_n_s_pack;
2681 static PyObject *__pyx_n_s_pickle;
2682 static PyObject *__pyx_n_s_prepare;
2683 static PyObject *__pyx_kp_s_proteus_superluWrappers_pyx;
2684 static PyObject *__pyx_n_s_pyx_PickleError;
2685 static PyObject *__pyx_n_s_pyx_checksum;
2686 static PyObject *__pyx_n_s_pyx_getbuffer;
2687 static PyObject *__pyx_n_s_pyx_result;
2688 static PyObject *__pyx_n_s_pyx_state;
2689 static PyObject *__pyx_n_s_pyx_type;
2690 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2691 static PyObject *__pyx_n_s_pyx_vtable;
2692 static PyObject *__pyx_n_s_qualname;
2693 static PyObject *__pyx_n_s_range;
2694 static PyObject *__pyx_n_s_range_end;
2695 static PyObject *__pyx_n_s_range_start;
2696 static PyObject *__pyx_n_s_reduce;
2697 static PyObject *__pyx_n_s_reduce_cython;
2698 static PyObject *__pyx_n_s_reduce_ex;
2699 static PyObject *__pyx_n_s_rowptr;
2700 static PyObject *__pyx_n_s_rows;
2701 static PyObject *__pyx_n_s_self;
2702 static PyObject *__pyx_kp_s_self_A_self_AC_self_L_self_U_sel;
2703 static PyObject *__pyx_n_s_setstate;
2704 static PyObject *__pyx_n_s_setstate_cython;
2705 static PyObject *__pyx_n_s_shape;
2706 static PyObject *__pyx_n_s_size;
2707 static PyObject *__pyx_n_s_sparseFactor;
2708 static PyObject *__pyx_n_s_sparseFactorPrepare;
2709 static PyObject *__pyx_n_s_sparseFactorSolve;
2710 static PyObject *__pyx_n_s_sparse_matrix;
2711 static PyObject *__pyx_n_s_start;
2712 static PyObject *__pyx_n_s_step;
2713 static PyObject *__pyx_n_s_stop;
2714 static PyObject *__pyx_kp_s_strided_and_direct;
2715 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2716 static PyObject *__pyx_kp_s_strided_and_indirect;
2717 static PyObject *__pyx_kp_s_stringsource;
2718 static PyObject *__pyx_n_s_struct;
2719 static PyObject *__pyx_n_s_superluWrappers;
2720 static PyObject *__pyx_n_s_test;
2721 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2722 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2723 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2724 static PyObject *__pyx_n_s_unpack;
2725 static PyObject *__pyx_n_s_update;
2726 static PyObject *__pyx_n_s_w;
2727 static PyObject *__pyx_n_s_write;
2728 static PyObject *__pyx_n_s_x;
2729 static PyObject *__pyx_n_s_y;
2730 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc, PyObject *__pyx_v_nnz, PyObject *__pyx_v_nzvals, PyObject *__pyx_v_colind, PyObject *__pyx_v_rowptr); /* proto */
2731 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_2matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
2732 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_base); /* proto */
2733 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
2734 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_range_start, PyObject *__pyx_v_range_end); /* proto */
2735 static int __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, int __pyx_v_nr, int __pyx_v_nc, int __pyx_v_nnz, __Pyx_memviewslice __pyx_v_nzval, __Pyx_memviewslice __pyx_v_colind, __Pyx_memviewslice __pyx_v_rowptr); /* proto */
2736 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self); /* proto */
2737 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2738 static int __pyx_pf_15superluWrappers_12SparseFactor___init__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */
2739 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self); /* proto */
2740 static int __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2741 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self); /* proto */
2742 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2743 static PyObject *__pyx_pf_15superluWrappers_sparseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparse_matrix, PyObject *__pyx_v_sparseFactor); /* proto */
2744 static PyObject *__pyx_pf_15superluWrappers_2sparseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparseFactor, PyObject *__pyx_v_x); /* proto */
2745 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2746 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
2747 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2748 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2749 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2750 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2751 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2752 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2753 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2754 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2755 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2756 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2757 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2758 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2759 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2760 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2761 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2762 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2763 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2764 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2765 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2766 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2767 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2768 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2769 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2770 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2771 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2772 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2773 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2774 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2775 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2776 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2777 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2778 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2779 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2780 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2781 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2782 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2783 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2784 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2785 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2786 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2787 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2788 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2789 static PyObject *__pyx_tp_new_15superluWrappers_cSparseMatrix(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2790 static PyObject *__pyx_tp_new_15superluWrappers_SparseFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2791 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2792 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2793 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2794 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2795 static PyObject *__pyx_int_0;
2796 static PyObject *__pyx_int_1;
2797 static PyObject *__pyx_int_184977713;
2798 static PyObject *__pyx_int_neg_1;
2799 static PyObject *__pyx_tuple_;
2800 static PyObject *__pyx_tuple__2;
2801 static PyObject *__pyx_tuple__3;
2802 static PyObject *__pyx_tuple__4;
2803 static PyObject *__pyx_tuple__5;
2804 static PyObject *__pyx_tuple__6;
2805 static PyObject *__pyx_tuple__7;
2806 static PyObject *__pyx_tuple__8;
2807 static PyObject *__pyx_tuple__9;
2808 static PyObject *__pyx_slice__27;
2809 static PyObject *__pyx_tuple__10;
2810 static PyObject *__pyx_tuple__11;
2811 static PyObject *__pyx_tuple__12;
2812 static PyObject *__pyx_tuple__13;
2813 static PyObject *__pyx_tuple__14;
2814 static PyObject *__pyx_tuple__15;
2815 static PyObject *__pyx_tuple__16;
2816 static PyObject *__pyx_tuple__17;
2817 static PyObject *__pyx_tuple__18;
2818 static PyObject *__pyx_tuple__19;
2819 static PyObject *__pyx_tuple__20;
2820 static PyObject *__pyx_tuple__21;
2821 static PyObject *__pyx_tuple__22;
2822 static PyObject *__pyx_tuple__23;
2823 static PyObject *__pyx_tuple__24;
2824 static PyObject *__pyx_tuple__25;
2825 static PyObject *__pyx_tuple__26;
2826 static PyObject *__pyx_tuple__28;
2827 static PyObject *__pyx_tuple__29;
2828 static PyObject *__pyx_tuple__30;
2829 static PyObject *__pyx_tuple__31;
2830 static PyObject *__pyx_tuple__32;
2831 static PyObject *__pyx_tuple__34;
2832 static PyObject *__pyx_tuple__36;
2833 static PyObject *__pyx_tuple__38;
2834 static PyObject *__pyx_tuple__40;
2835 static PyObject *__pyx_tuple__42;
2836 static PyObject *__pyx_tuple__44;
2837 static PyObject *__pyx_tuple__46;
2838 static PyObject *__pyx_tuple__47;
2839 static PyObject *__pyx_tuple__48;
2840 static PyObject *__pyx_tuple__49;
2841 static PyObject *__pyx_tuple__50;
2842 static PyObject *__pyx_tuple__51;
2843 static PyObject *__pyx_codeobj__33;
2844 static PyObject *__pyx_codeobj__35;
2845 static PyObject *__pyx_codeobj__37;
2846 static PyObject *__pyx_codeobj__39;
2847 static PyObject *__pyx_codeobj__41;
2848 static PyObject *__pyx_codeobj__43;
2849 static PyObject *__pyx_codeobj__45;
2850 static PyObject *__pyx_codeobj__52;
2851 /* Late includes */
2852 
2853 /* "superluWrappers.pyx":15
2854  * class SparseMatrix(object):
2855  *
2856  * def __init__(self, # <<<<<<<<<<<<<<
2857  * nr,
2858  * nc,
2859  */
2860 
2861 /* Python wrapper */
2862 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2863 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
2864 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2865  PyObject *__pyx_v_self = 0;
2866  PyObject *__pyx_v_nr = 0;
2867  PyObject *__pyx_v_nc = 0;
2868  PyObject *__pyx_v_nnz = 0;
2869  PyObject *__pyx_v_nzvals = 0;
2870  PyObject *__pyx_v_colind = 0;
2871  PyObject *__pyx_v_rowptr = 0;
2872  PyObject *__pyx_r = 0;
2873  __Pyx_RefNannyDeclarations
2874  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
2875  {
2876  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_nr,&__pyx_n_s_nc,&__pyx_n_s_nnz,&__pyx_n_s_nzvals,&__pyx_n_s_colind,&__pyx_n_s_rowptr,0};
2877  PyObject* values[7] = {0,0,0,0,0,0,0};
2878  if (unlikely(__pyx_kwds)) {
2879  Py_ssize_t kw_args;
2880  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2881  switch (pos_args) {
2882  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2883  CYTHON_FALLTHROUGH;
2884  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2885  CYTHON_FALLTHROUGH;
2886  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2887  CYTHON_FALLTHROUGH;
2888  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2889  CYTHON_FALLTHROUGH;
2890  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2891  CYTHON_FALLTHROUGH;
2892  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2893  CYTHON_FALLTHROUGH;
2894  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2895  CYTHON_FALLTHROUGH;
2896  case 0: break;
2897  default: goto __pyx_L5_argtuple_error;
2898  }
2899  kw_args = PyDict_Size(__pyx_kwds);
2900  switch (pos_args) {
2901  case 0:
2902  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2903  else goto __pyx_L5_argtuple_error;
2904  CYTHON_FALLTHROUGH;
2905  case 1:
2906  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nr)) != 0)) kw_args--;
2907  else {
2908  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 1); __PYX_ERR(0, 15, __pyx_L3_error)
2909  }
2910  CYTHON_FALLTHROUGH;
2911  case 2:
2912  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--;
2913  else {
2914  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 2); __PYX_ERR(0, 15, __pyx_L3_error)
2915  }
2916  CYTHON_FALLTHROUGH;
2917  case 3:
2918  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
2919  else {
2920  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 3); __PYX_ERR(0, 15, __pyx_L3_error)
2921  }
2922  CYTHON_FALLTHROUGH;
2923  case 4:
2924  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nzvals)) != 0)) kw_args--;
2925  else {
2926  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 4); __PYX_ERR(0, 15, __pyx_L3_error)
2927  }
2928  CYTHON_FALLTHROUGH;
2929  case 5:
2930  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
2931  else {
2932  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 5); __PYX_ERR(0, 15, __pyx_L3_error)
2933  }
2934  CYTHON_FALLTHROUGH;
2935  case 6:
2936  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
2937  else {
2938  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 6); __PYX_ERR(0, 15, __pyx_L3_error)
2939  }
2940  }
2941  if (unlikely(kw_args > 0)) {
2942  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 15, __pyx_L3_error)
2943  }
2944  } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
2945  goto __pyx_L5_argtuple_error;
2946  } else {
2947  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2948  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2949  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2950  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2951  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2952  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2953  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2954  }
2955  __pyx_v_self = values[0];
2956  __pyx_v_nr = values[1];
2957  __pyx_v_nc = values[2];
2958  __pyx_v_nnz = values[3];
2959  __pyx_v_nzvals = values[4];
2960  __pyx_v_colind = values[5];
2961  __pyx_v_rowptr = values[6];
2962  }
2963  goto __pyx_L4_argument_unpacking_done;
2964  __pyx_L5_argtuple_error:;
2965  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 15, __pyx_L3_error)
2966  __pyx_L3_error:;
2967  __Pyx_AddTraceback("superluWrappers.SparseMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2968  __Pyx_RefNannyFinishContext();
2969  return NULL;
2970  __pyx_L4_argument_unpacking_done:;
2971  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix___init__(__pyx_self, __pyx_v_self, __pyx_v_nr, __pyx_v_nc, __pyx_v_nnz, __pyx_v_nzvals, __pyx_v_colind, __pyx_v_rowptr);
2972 
2973  /* function exit code */
2974  __Pyx_RefNannyFinishContext();
2975  return __pyx_r;
2976 }
2977 
2978 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc, PyObject *__pyx_v_nnz, PyObject *__pyx_v_nzvals, PyObject *__pyx_v_colind, PyObject *__pyx_v_rowptr) {
2979  PyObject *__pyx_r = NULL;
2980  __Pyx_RefNannyDeclarations
2981  PyObject *__pyx_t_1 = NULL;
2982  PyObject *__pyx_t_2 = NULL;
2983  PyObject *__pyx_t_3 = NULL;
2984  PyObject *__pyx_t_4 = NULL;
2985  __Pyx_RefNannySetupContext("__init__", 0);
2986 
2987  /* "superluWrappers.pyx":22
2988  * colind,
2989  * rowptr):
2990  * self.nr = nr ; self.nc = nc # <<<<<<<<<<<<<<
2991  * self.nnz = nnz
2992  * self.shape = [self.nr, self.nc]
2993  */
2994  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nr, __pyx_v_nr) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
2995  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nc, __pyx_v_nc) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
2996 
2997  /* "superluWrappers.pyx":23
2998  * rowptr):
2999  * self.nr = nr ; self.nc = nc
3000  * self.nnz = nnz # <<<<<<<<<<<<<<
3001  * self.shape = [self.nr, self.nc]
3002  * self.nzvals = nzvals
3003  */
3004  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nnz, __pyx_v_nnz) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
3005 
3006  /* "superluWrappers.pyx":24
3007  * self.nr = nr ; self.nc = nc
3008  * self.nnz = nnz
3009  * self.shape = [self.nr, self.nc] # <<<<<<<<<<<<<<
3010  * self.nzvals = nzvals
3011  * self.colind = colind
3012  */
3013  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
3014  __Pyx_GOTREF(__pyx_t_1);
3015  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
3016  __Pyx_GOTREF(__pyx_t_2);
3017  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
3018  __Pyx_GOTREF(__pyx_t_3);
3019  __Pyx_GIVEREF(__pyx_t_1);
3020  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
3021  __Pyx_GIVEREF(__pyx_t_2);
3022  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
3023  __pyx_t_1 = 0;
3024  __pyx_t_2 = 0;
3025  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
3026  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3027 
3028  /* "superluWrappers.pyx":25
3029  * self.nnz = nnz
3030  * self.shape = [self.nr, self.nc]
3031  * self.nzvals = nzvals # <<<<<<<<<<<<<<
3032  * self.colind = colind
3033  * self.rowptr = rowptr
3034  */
3035  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nzvals, __pyx_v_nzvals) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
3036 
3037  /* "superluWrappers.pyx":26
3038  * self.shape = [self.nr, self.nc]
3039  * self.nzvals = nzvals
3040  * self.colind = colind # <<<<<<<<<<<<<<
3041  * self.rowptr = rowptr
3042  * self._cSparseMatrix = cSparseMatrix(nr,
3043  */
3044  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_colind, __pyx_v_colind) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
3045 
3046  /* "superluWrappers.pyx":27
3047  * self.nzvals = nzvals
3048  * self.colind = colind
3049  * self.rowptr = rowptr # <<<<<<<<<<<<<<
3050  * self._cSparseMatrix = cSparseMatrix(nr,
3051  * nc,
3052  */
3053  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rowptr, __pyx_v_rowptr) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
3054 
3055  /* "superluWrappers.pyx":31
3056  * nc,
3057  * nnz,
3058  * self.nzvals, # <<<<<<<<<<<<<<
3059  * self.colind,
3060  * self.rowptr)
3061  */
3062  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
3063  __Pyx_GOTREF(__pyx_t_3);
3064 
3065  /* "superluWrappers.pyx":32
3066  * nnz,
3067  * self.nzvals,
3068  * self.colind, # <<<<<<<<<<<<<<
3069  * self.rowptr)
3070  *
3071  */
3072  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
3073  __Pyx_GOTREF(__pyx_t_2);
3074 
3075  /* "superluWrappers.pyx":33
3076  * self.nzvals,
3077  * self.colind,
3078  * self.rowptr) # <<<<<<<<<<<<<<
3079  *
3080  * def matvec(self, x, y):
3081  */
3082  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
3083  __Pyx_GOTREF(__pyx_t_1);
3084 
3085  /* "superluWrappers.pyx":28
3086  * self.colind = colind
3087  * self.rowptr = rowptr
3088  * self._cSparseMatrix = cSparseMatrix(nr, # <<<<<<<<<<<<<<
3089  * nc,
3090  * nnz,
3091  */
3092  __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error)
3093  __Pyx_GOTREF(__pyx_t_4);
3094  __Pyx_INCREF(__pyx_v_nr);
3095  __Pyx_GIVEREF(__pyx_v_nr);
3096  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_nr);
3097  __Pyx_INCREF(__pyx_v_nc);
3098  __Pyx_GIVEREF(__pyx_v_nc);
3099  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_nc);
3100  __Pyx_INCREF(__pyx_v_nnz);
3101  __Pyx_GIVEREF(__pyx_v_nnz);
3102  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_nnz);
3103  __Pyx_GIVEREF(__pyx_t_3);
3104  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
3105  __Pyx_GIVEREF(__pyx_t_2);
3106  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_2);
3107  __Pyx_GIVEREF(__pyx_t_1);
3108  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_1);
3109  __pyx_t_3 = 0;
3110  __pyx_t_2 = 0;
3111  __pyx_t_1 = 0;
3112  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_15superluWrappers_cSparseMatrix), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
3113  __Pyx_GOTREF(__pyx_t_1);
3114  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3115  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cSparseMatrix, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
3116  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3117 
3118  /* "superluWrappers.pyx":15
3119  * class SparseMatrix(object):
3120  *
3121  * def __init__(self, # <<<<<<<<<<<<<<
3122  * nr,
3123  * nc,
3124  */
3125 
3126  /* function exit code */
3127  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3128  goto __pyx_L0;
3129  __pyx_L1_error:;
3130  __Pyx_XDECREF(__pyx_t_1);
3131  __Pyx_XDECREF(__pyx_t_2);
3132  __Pyx_XDECREF(__pyx_t_3);
3133  __Pyx_XDECREF(__pyx_t_4);
3134  __Pyx_AddTraceback("superluWrappers.SparseMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3135  __pyx_r = NULL;
3136  __pyx_L0:;
3137  __Pyx_XGIVEREF(__pyx_r);
3138  __Pyx_RefNannyFinishContext();
3139  return __pyx_r;
3140 }
3141 
3142 /* "superluWrappers.pyx":35
3143  * self.rowptr)
3144  *
3145  * def matvec(self, x, y): # <<<<<<<<<<<<<<
3146  * """
3147  * Compute the sparse matrix-vector product y = Ax
3148  */
3149 
3150 /* Python wrapper */
3151 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_3matvec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3152 static char __pyx_doc_15superluWrappers_12SparseMatrix_2matvec[] = "\n Compute the sparse matrix-vector product y = Ax\n\n Arguments\n ---------\n x (input) : numpy array\n y (output) : numpy array\n ";
3153 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_3matvec = {"matvec", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_3matvec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_2matvec};
3154 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_3matvec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3155  PyObject *__pyx_v_self = 0;
3156  PyObject *__pyx_v_x = 0;
3157  PyObject *__pyx_v_y = 0;
3158  PyObject *__pyx_r = 0;
3159  __Pyx_RefNannyDeclarations
3160  __Pyx_RefNannySetupContext("matvec (wrapper)", 0);
3161  {
3162  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,0};
3163  PyObject* values[3] = {0,0,0};
3164  if (unlikely(__pyx_kwds)) {
3165  Py_ssize_t kw_args;
3166  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3167  switch (pos_args) {
3168  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3169  CYTHON_FALLTHROUGH;
3170  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3171  CYTHON_FALLTHROUGH;
3172  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3173  CYTHON_FALLTHROUGH;
3174  case 0: break;
3175  default: goto __pyx_L5_argtuple_error;
3176  }
3177  kw_args = PyDict_Size(__pyx_kwds);
3178  switch (pos_args) {
3179  case 0:
3180  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3181  else goto __pyx_L5_argtuple_error;
3182  CYTHON_FALLTHROUGH;
3183  case 1:
3184  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
3185  else {
3186  __Pyx_RaiseArgtupleInvalid("matvec", 1, 3, 3, 1); __PYX_ERR(0, 35, __pyx_L3_error)
3187  }
3188  CYTHON_FALLTHROUGH;
3189  case 2:
3190  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
3191  else {
3192  __Pyx_RaiseArgtupleInvalid("matvec", 1, 3, 3, 2); __PYX_ERR(0, 35, __pyx_L3_error)
3193  }
3194  }
3195  if (unlikely(kw_args > 0)) {
3196  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matvec") < 0)) __PYX_ERR(0, 35, __pyx_L3_error)
3197  }
3198  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3199  goto __pyx_L5_argtuple_error;
3200  } else {
3201  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3202  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3203  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3204  }
3205  __pyx_v_self = values[0];
3206  __pyx_v_x = values[1];
3207  __pyx_v_y = values[2];
3208  }
3209  goto __pyx_L4_argument_unpacking_done;
3210  __pyx_L5_argtuple_error:;
3211  __Pyx_RaiseArgtupleInvalid("matvec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 35, __pyx_L3_error)
3212  __pyx_L3_error:;
3213  __Pyx_AddTraceback("superluWrappers.SparseMatrix.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
3214  __Pyx_RefNannyFinishContext();
3215  return NULL;
3216  __pyx_L4_argument_unpacking_done:;
3217  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_2matvec(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y);
3218 
3219  /* function exit code */
3220  __Pyx_RefNannyFinishContext();
3221  return __pyx_r;
3222 }
3223 
3224 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_2matvec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
3225  PyObject *__pyx_r = NULL;
3226  __Pyx_RefNannyDeclarations
3227  PyObject *__pyx_t_1 = NULL;
3228  __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
3229  __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
3230  __Pyx_RefNannySetupContext("matvec", 0);
3231 
3232  /* "superluWrappers.pyx":44
3233  * y (output) : numpy array
3234  * """
3235  * SparseMatrix_matvec(self._cSparseMatrix, x, y) # <<<<<<<<<<<<<<
3236  *
3237  * def fwrite(self, filename, base):
3238  */
3239  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
3240  __Pyx_GOTREF(__pyx_t_1);
3241  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 44, __pyx_L1_error)
3242  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_x, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 44, __pyx_L1_error)
3243  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_y, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 44, __pyx_L1_error)
3244  __pyx_f_15superluWrappers_SparseMatrix_matvec(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3);
3245  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3246  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
3247  __pyx_t_2.memview = NULL;
3248  __pyx_t_2.data = NULL;
3249  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
3250  __pyx_t_3.memview = NULL;
3251  __pyx_t_3.data = NULL;
3252 
3253  /* "superluWrappers.pyx":35
3254  * self.rowptr)
3255  *
3256  * def matvec(self, x, y): # <<<<<<<<<<<<<<
3257  * """
3258  * Compute the sparse matrix-vector product y = Ax
3259  */
3260 
3261  /* function exit code */
3262  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3263  goto __pyx_L0;
3264  __pyx_L1_error:;
3265  __Pyx_XDECREF(__pyx_t_1);
3266  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
3267  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
3268  __Pyx_AddTraceback("superluWrappers.SparseMatrix.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
3269  __pyx_r = NULL;
3270  __pyx_L0:;
3271  __Pyx_XGIVEREF(__pyx_r);
3272  __Pyx_RefNannyFinishContext();
3273  return __pyx_r;
3274 }
3275 
3276 /* "superluWrappers.pyx":46
3277  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
3278  *
3279  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
3280  * """ Write the sparse matrix to a file
3281  *
3282  */
3283 
3284 /* Python wrapper */
3285 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3286 static char __pyx_doc_15superluWrappers_12SparseMatrix_4fwrite[] = " Write the sparse matrix to a file\n\n Arguments\n ---------\n filename : str\n The output filename\n base : int\n ?!Possibly something to do with parallel?!\n ";
3287 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_5fwrite = {"fwrite", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_4fwrite};
3288 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3289  PyObject *__pyx_v_self = 0;
3290  PyObject *__pyx_v_filename = 0;
3291  PyObject *__pyx_v_base = 0;
3292  PyObject *__pyx_r = 0;
3293  __Pyx_RefNannyDeclarations
3294  __Pyx_RefNannySetupContext("fwrite (wrapper)", 0);
3295  {
3296  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filename,&__pyx_n_s_base,0};
3297  PyObject* values[3] = {0,0,0};
3298  if (unlikely(__pyx_kwds)) {
3299  Py_ssize_t kw_args;
3300  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3301  switch (pos_args) {
3302  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3303  CYTHON_FALLTHROUGH;
3304  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3305  CYTHON_FALLTHROUGH;
3306  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3307  CYTHON_FALLTHROUGH;
3308  case 0: break;
3309  default: goto __pyx_L5_argtuple_error;
3310  }
3311  kw_args = PyDict_Size(__pyx_kwds);
3312  switch (pos_args) {
3313  case 0:
3314  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3315  else goto __pyx_L5_argtuple_error;
3316  CYTHON_FALLTHROUGH;
3317  case 1:
3318  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
3319  else {
3320  __Pyx_RaiseArgtupleInvalid("fwrite", 1, 3, 3, 1); __PYX_ERR(0, 46, __pyx_L3_error)
3321  }
3322  CYTHON_FALLTHROUGH;
3323  case 2:
3324  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base)) != 0)) kw_args--;
3325  else {
3326  __Pyx_RaiseArgtupleInvalid("fwrite", 1, 3, 3, 2); __PYX_ERR(0, 46, __pyx_L3_error)
3327  }
3328  }
3329  if (unlikely(kw_args > 0)) {
3330  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fwrite") < 0)) __PYX_ERR(0, 46, __pyx_L3_error)
3331  }
3332  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3333  goto __pyx_L5_argtuple_error;
3334  } else {
3335  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3336  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3337  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3338  }
3339  __pyx_v_self = values[0];
3340  __pyx_v_filename = values[1];
3341  __pyx_v_base = values[2];
3342  }
3343  goto __pyx_L4_argument_unpacking_done;
3344  __pyx_L5_argtuple_error:;
3345  __Pyx_RaiseArgtupleInvalid("fwrite", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 46, __pyx_L3_error)
3346  __pyx_L3_error:;
3347  __Pyx_AddTraceback("superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
3348  __Pyx_RefNannyFinishContext();
3349  return NULL;
3350  __pyx_L4_argument_unpacking_done:;
3351  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(__pyx_self, __pyx_v_self, __pyx_v_filename, __pyx_v_base);
3352 
3353  /* function exit code */
3354  __Pyx_RefNannyFinishContext();
3355  return __pyx_r;
3356 }
3357 
3358 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_4fwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_base) {
3359  PyObject *__pyx_v_output_file = NULL;
3360  PyObject *__pyx_v_i = NULL;
3361  PyObject *__pyx_v_k = NULL;
3362  PyObject *__pyx_r = NULL;
3363  __Pyx_RefNannyDeclarations
3364  PyObject *__pyx_t_1 = NULL;
3365  PyObject *__pyx_t_2 = NULL;
3366  PyObject *__pyx_t_3 = NULL;
3367  PyObject *__pyx_t_4 = NULL;
3368  PyObject *__pyx_t_5 = NULL;
3369  PyObject *__pyx_t_6 = NULL;
3370  PyObject *__pyx_t_7 = NULL;
3371  PyObject *__pyx_t_8 = NULL;
3372  PyObject *__pyx_t_9 = NULL;
3373  PyObject *__pyx_t_10 = NULL;
3374  PyObject *__pyx_t_11 = NULL;
3375  Py_ssize_t __pyx_t_12;
3376  PyObject *(*__pyx_t_13)(PyObject *);
3377  Py_ssize_t __pyx_t_14;
3378  PyObject *(*__pyx_t_15)(PyObject *);
3379  PyObject *__pyx_t_16 = NULL;
3380  PyObject *__pyx_t_17 = NULL;
3381  int __pyx_t_18;
3382  int __pyx_t_19;
3383  __Pyx_RefNannySetupContext("fwrite", 0);
3384 
3385  /* "superluWrappers.pyx":56
3386  * ?!Possibly something to do with parallel?!
3387  * """
3388  * with open(filename, 'w') as output_file: # <<<<<<<<<<<<<<
3389  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3390  * for i in range(self.nr):
3391  */
3392  /*with:*/ {
3393  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
3394  __Pyx_GOTREF(__pyx_t_1);
3395  __Pyx_INCREF(__pyx_v_filename);
3396  __Pyx_GIVEREF(__pyx_v_filename);
3397  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
3398  __Pyx_INCREF(__pyx_n_s_w);
3399  __Pyx_GIVEREF(__pyx_n_s_w);
3400  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_w);
3401  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
3402  __Pyx_GOTREF(__pyx_t_2);
3403  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3404  __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
3405  __Pyx_GOTREF(__pyx_t_3);
3406  __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L3_error)
3407  __Pyx_GOTREF(__pyx_t_4);
3408  __pyx_t_5 = NULL;
3409  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3410  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3411  if (likely(__pyx_t_5)) {
3412  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3413  __Pyx_INCREF(__pyx_t_5);
3414  __Pyx_INCREF(function);
3415  __Pyx_DECREF_SET(__pyx_t_4, function);
3416  }
3417  }
3418  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
3419  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3420  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L3_error)
3421  __Pyx_GOTREF(__pyx_t_1);
3422  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3423  __pyx_t_4 = __pyx_t_1;
3424  __pyx_t_1 = 0;
3425  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3426  /*try:*/ {
3427  {
3428  __Pyx_PyThreadState_declare
3429  __Pyx_PyThreadState_assign
3430  __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
3431  __Pyx_XGOTREF(__pyx_t_6);
3432  __Pyx_XGOTREF(__pyx_t_7);
3433  __Pyx_XGOTREF(__pyx_t_8);
3434  /*try:*/ {
3435  __pyx_v_output_file = __pyx_t_4;
3436  __pyx_t_4 = 0;
3437 
3438  /* "superluWrappers.pyx":57
3439  * """
3440  * with open(filename, 'w') as output_file:
3441  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) ) # <<<<<<<<<<<<<<
3442  * for i in range(self.nr):
3443  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3444  */
3445  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_file, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L7_error)
3446  __Pyx_GOTREF(__pyx_t_2);
3447  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L7_error)
3448  __Pyx_GOTREF(__pyx_t_1);
3449  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L7_error)
3450  __Pyx_GOTREF(__pyx_t_5);
3451  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 57, __pyx_L7_error)
3452  __Pyx_GOTREF(__pyx_t_9);
3453  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 57, __pyx_L7_error)
3454  __Pyx_GOTREF(__pyx_t_10);
3455  __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L7_error)
3456  __Pyx_GOTREF(__pyx_t_11);
3457  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3458  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3459  __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 57, __pyx_L7_error)
3460  __Pyx_GOTREF(__pyx_t_10);
3461  __Pyx_GIVEREF(__pyx_t_1);
3462  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
3463  __Pyx_GIVEREF(__pyx_t_5);
3464  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
3465  __Pyx_GIVEREF(__pyx_t_11);
3466  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_11);
3467  __pyx_t_1 = 0;
3468  __pyx_t_5 = 0;
3469  __pyx_t_11 = 0;
3470  __pyx_t_11 = __Pyx_PyString_Format(__pyx_kp_s_i_i_i, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 57, __pyx_L7_error)
3471  __Pyx_GOTREF(__pyx_t_11);
3472  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3473  __pyx_t_10 = NULL;
3474  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3475  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
3476  if (likely(__pyx_t_10)) {
3477  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3478  __Pyx_INCREF(__pyx_t_10);
3479  __Pyx_INCREF(function);
3480  __Pyx_DECREF_SET(__pyx_t_2, function);
3481  }
3482  }
3483  __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_10, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_11);
3484  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3485  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3486  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L7_error)
3487  __Pyx_GOTREF(__pyx_t_4);
3488  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3489  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3490 
3491  /* "superluWrappers.pyx":58
3492  * with open(filename, 'w') as output_file:
3493  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3494  * for i in range(self.nr): # <<<<<<<<<<<<<<
3495  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3496  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3497  */
3498  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L7_error)
3499  __Pyx_GOTREF(__pyx_t_4);
3500  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L7_error)
3501  __Pyx_GOTREF(__pyx_t_2);
3502  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3503  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
3504  __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_12 = 0;
3505  __pyx_t_13 = NULL;
3506  } else {
3507  __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L7_error)
3508  __Pyx_GOTREF(__pyx_t_4);
3509  __pyx_t_13 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 58, __pyx_L7_error)
3510  }
3511  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3512  for (;;) {
3513  if (likely(!__pyx_t_13)) {
3514  if (likely(PyList_CheckExact(__pyx_t_4))) {
3515  if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_4)) break;
3516  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3517  __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 58, __pyx_L7_error)
3518  #else
3519  __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L7_error)
3520  __Pyx_GOTREF(__pyx_t_2);
3521  #endif
3522  } else {
3523  if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
3524  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3525  __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 58, __pyx_L7_error)
3526  #else
3527  __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L7_error)
3528  __Pyx_GOTREF(__pyx_t_2);
3529  #endif
3530  }
3531  } else {
3532  __pyx_t_2 = __pyx_t_13(__pyx_t_4);
3533  if (unlikely(!__pyx_t_2)) {
3534  PyObject* exc_type = PyErr_Occurred();
3535  if (exc_type) {
3536  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3537  else __PYX_ERR(0, 58, __pyx_L7_error)
3538  }
3539  break;
3540  }
3541  __Pyx_GOTREF(__pyx_t_2);
3542  }
3543  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
3544  __pyx_t_2 = 0;
3545 
3546  /* "superluWrappers.pyx":59
3547  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3548  * for i in range(self.nr):
3549  * for k in range(self.rowptr[i], self.rowptr[i+1]): # <<<<<<<<<<<<<<
3550  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3551  *
3552  */
3553  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L7_error)
3554  __Pyx_GOTREF(__pyx_t_2);
3555  __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_i); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L7_error)
3556  __Pyx_GOTREF(__pyx_t_11);
3557  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3558  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L7_error)
3559  __Pyx_GOTREF(__pyx_t_2);
3560  __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3561  __Pyx_GOTREF(__pyx_t_10);
3562  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
3563  __Pyx_GOTREF(__pyx_t_5);
3564  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3565  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3566  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3567  __Pyx_GOTREF(__pyx_t_10);
3568  __Pyx_GIVEREF(__pyx_t_11);
3569  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11);
3570  __Pyx_GIVEREF(__pyx_t_5);
3571  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
3572  __pyx_t_11 = 0;
3573  __pyx_t_5 = 0;
3574  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
3575  __Pyx_GOTREF(__pyx_t_5);
3576  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3577  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
3578  __pyx_t_10 = __pyx_t_5; __Pyx_INCREF(__pyx_t_10); __pyx_t_14 = 0;
3579  __pyx_t_15 = NULL;
3580  } else {
3581  __pyx_t_14 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L7_error)
3582  __Pyx_GOTREF(__pyx_t_10);
3583  __pyx_t_15 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 59, __pyx_L7_error)
3584  }
3585  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3586  for (;;) {
3587  if (likely(!__pyx_t_15)) {
3588  if (likely(PyList_CheckExact(__pyx_t_10))) {
3589  if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_10)) break;
3590  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3591  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_14); __Pyx_INCREF(__pyx_t_5); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 59, __pyx_L7_error)
3592  #else
3593  __pyx_t_5 = PySequence_ITEM(__pyx_t_10, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
3594  __Pyx_GOTREF(__pyx_t_5);
3595  #endif
3596  } else {
3597  if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
3598  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3599  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_14); __Pyx_INCREF(__pyx_t_5); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 59, __pyx_L7_error)
3600  #else
3601  __pyx_t_5 = PySequence_ITEM(__pyx_t_10, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L7_error)
3602  __Pyx_GOTREF(__pyx_t_5);
3603  #endif
3604  }
3605  } else {
3606  __pyx_t_5 = __pyx_t_15(__pyx_t_10);
3607  if (unlikely(!__pyx_t_5)) {
3608  PyObject* exc_type = PyErr_Occurred();
3609  if (exc_type) {
3610  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3611  else __PYX_ERR(0, 59, __pyx_L7_error)
3612  }
3613  break;
3614  }
3615  __Pyx_GOTREF(__pyx_t_5);
3616  }
3617  __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5);
3618  __pyx_t_5 = 0;
3619 
3620  /* "superluWrappers.pyx":60
3621  * for i in range(self.nr):
3622  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3623  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) ) # <<<<<<<<<<<<<<
3624  *
3625  * def getCSRrepresentation(self):
3626  */
3627  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_file, __pyx_n_s_write); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L7_error)
3628  __Pyx_GOTREF(__pyx_t_11);
3629  __pyx_t_2 = PyNumber_Add(__pyx_v_i, __pyx_v_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L7_error)
3630  __Pyx_GOTREF(__pyx_t_2);
3631  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L7_error)
3632  __Pyx_GOTREF(__pyx_t_1);
3633  __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_k); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L7_error)
3634  __Pyx_GOTREF(__pyx_t_9);
3635  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3636  __pyx_t_1 = PyNumber_Add(__pyx_t_9, __pyx_v_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L7_error)
3637  __Pyx_GOTREF(__pyx_t_1);
3638  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3639  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L7_error)
3640  __Pyx_GOTREF(__pyx_t_9);
3641  __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_v_k); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 60, __pyx_L7_error)
3642  __Pyx_GOTREF(__pyx_t_16);
3643  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3644  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L7_error)
3645  __Pyx_GOTREF(__pyx_t_9);
3646  __Pyx_GIVEREF(__pyx_t_2);
3647  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
3648  __Pyx_GIVEREF(__pyx_t_1);
3649  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
3650  __Pyx_GIVEREF(__pyx_t_16);
3651  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_16);
3652  __pyx_t_2 = 0;
3653  __pyx_t_1 = 0;
3654  __pyx_t_16 = 0;
3655  __pyx_t_16 = __Pyx_PyString_Format(__pyx_kp_s_d_d_13_8e, __pyx_t_9); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 60, __pyx_L7_error)
3656  __Pyx_GOTREF(__pyx_t_16);
3657  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3658  __pyx_t_9 = NULL;
3659  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
3660  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
3661  if (likely(__pyx_t_9)) {
3662  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
3663  __Pyx_INCREF(__pyx_t_9);
3664  __Pyx_INCREF(function);
3665  __Pyx_DECREF_SET(__pyx_t_11, function);
3666  }
3667  }
3668  __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_9, __pyx_t_16) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_16);
3669  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3670  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3671  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L7_error)
3672  __Pyx_GOTREF(__pyx_t_5);
3673  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3674  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3675 
3676  /* "superluWrappers.pyx":59
3677  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3678  * for i in range(self.nr):
3679  * for k in range(self.rowptr[i], self.rowptr[i+1]): # <<<<<<<<<<<<<<
3680  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3681  *
3682  */
3683  }
3684  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3685 
3686  /* "superluWrappers.pyx":58
3687  * with open(filename, 'w') as output_file:
3688  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3689  * for i in range(self.nr): # <<<<<<<<<<<<<<
3690  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3691  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3692  */
3693  }
3694  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3695 
3696  /* "superluWrappers.pyx":56
3697  * ?!Possibly something to do with parallel?!
3698  * """
3699  * with open(filename, 'w') as output_file: # <<<<<<<<<<<<<<
3700  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3701  * for i in range(self.nr):
3702  */
3703  }
3704  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3705  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3706  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3707  goto __pyx_L12_try_end;
3708  __pyx_L7_error:;
3709  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3710  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3711  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
3712  __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3713  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3714  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3715  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3716  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3717  /*except:*/ {
3718  __Pyx_AddTraceback("superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
3719  if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_10, &__pyx_t_5) < 0) __PYX_ERR(0, 56, __pyx_L9_except_error)
3720  __Pyx_GOTREF(__pyx_t_4);
3721  __Pyx_GOTREF(__pyx_t_10);
3722  __Pyx_GOTREF(__pyx_t_5);
3723  __pyx_t_11 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 56, __pyx_L9_except_error)
3724  __Pyx_GOTREF(__pyx_t_11);
3725  __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL);
3726  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3727  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3728  if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 56, __pyx_L9_except_error)
3729  __Pyx_GOTREF(__pyx_t_17);
3730  __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_17);
3731  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3732  if (__pyx_t_18 < 0) __PYX_ERR(0, 56, __pyx_L9_except_error)
3733  __pyx_t_19 = ((!(__pyx_t_18 != 0)) != 0);
3734  if (__pyx_t_19) {
3735  __Pyx_GIVEREF(__pyx_t_4);
3736  __Pyx_GIVEREF(__pyx_t_10);
3737  __Pyx_XGIVEREF(__pyx_t_5);
3738  __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_10, __pyx_t_5);
3739  __pyx_t_4 = 0; __pyx_t_10 = 0; __pyx_t_5 = 0;
3740  __PYX_ERR(0, 56, __pyx_L9_except_error)
3741  }
3742  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3743  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3744  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3745  goto __pyx_L8_exception_handled;
3746  }
3747  __pyx_L9_except_error:;
3748  __Pyx_XGIVEREF(__pyx_t_6);
3749  __Pyx_XGIVEREF(__pyx_t_7);
3750  __Pyx_XGIVEREF(__pyx_t_8);
3751  __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3752  goto __pyx_L1_error;
3753  __pyx_L8_exception_handled:;
3754  __Pyx_XGIVEREF(__pyx_t_6);
3755  __Pyx_XGIVEREF(__pyx_t_7);
3756  __Pyx_XGIVEREF(__pyx_t_8);
3757  __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3758  __pyx_L12_try_end:;
3759  }
3760  }
3761  /*finally:*/ {
3762  /*normal exit:*/{
3763  if (__pyx_t_3) {
3764  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL);
3765  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3766  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L1_error)
3767  __Pyx_GOTREF(__pyx_t_8);
3768  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3769  }
3770  goto __pyx_L6;
3771  }
3772  __pyx_L6:;
3773  }
3774  goto __pyx_L20;
3775  __pyx_L3_error:;
3776  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3777  goto __pyx_L1_error;
3778  __pyx_L20:;
3779  }
3780 
3781  /* "superluWrappers.pyx":46
3782  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
3783  *
3784  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
3785  * """ Write the sparse matrix to a file
3786  *
3787  */
3788 
3789  /* function exit code */
3790  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3791  goto __pyx_L0;
3792  __pyx_L1_error:;
3793  __Pyx_XDECREF(__pyx_t_1);
3794  __Pyx_XDECREF(__pyx_t_2);
3795  __Pyx_XDECREF(__pyx_t_4);
3796  __Pyx_XDECREF(__pyx_t_5);
3797  __Pyx_XDECREF(__pyx_t_9);
3798  __Pyx_XDECREF(__pyx_t_10);
3799  __Pyx_XDECREF(__pyx_t_11);
3800  __Pyx_XDECREF(__pyx_t_16);
3801  __Pyx_AddTraceback("superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
3802  __pyx_r = NULL;
3803  __pyx_L0:;
3804  __Pyx_XDECREF(__pyx_v_output_file);
3805  __Pyx_XDECREF(__pyx_v_i);
3806  __Pyx_XDECREF(__pyx_v_k);
3807  __Pyx_XGIVEREF(__pyx_r);
3808  __Pyx_RefNannyFinishContext();
3809  return __pyx_r;
3810 }
3811 
3812 /* "superluWrappers.pyx":62
3813  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3814  *
3815  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
3816  * """ Get the CSR representation of the sparse matrix.
3817  *
3818  */
3819 
3820 /* Python wrapper */
3821 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
3822 static char __pyx_doc_15superluWrappers_12SparseMatrix_6getCSRrepresentation[] = " Get the CSR representation of the sparse matrix.\n\n Returns\n -------\n csr_data : tuple of nparray\n (rowptr, colptr, vals)\n ";
3823 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_7getCSRrepresentation = {"getCSRrepresentation", (PyCFunction)__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation, METH_O, __pyx_doc_15superluWrappers_12SparseMatrix_6getCSRrepresentation};
3824 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_v_self) {
3825  PyObject *__pyx_r = 0;
3826  __Pyx_RefNannyDeclarations
3827  __Pyx_RefNannySetupContext("getCSRrepresentation (wrapper)", 0);
3828  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(__pyx_self, ((PyObject *)__pyx_v_self));
3829 
3830  /* function exit code */
3831  __Pyx_RefNannyFinishContext();
3832  return __pyx_r;
3833 }
3834 
3835 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
3836  PyObject *__pyx_r = NULL;
3837  __Pyx_RefNannyDeclarations
3838  PyObject *__pyx_t_1 = NULL;
3839  PyObject *__pyx_t_2 = NULL;
3840  PyObject *__pyx_t_3 = NULL;
3841  PyObject *__pyx_t_4 = NULL;
3842  __Pyx_RefNannySetupContext("getCSRrepresentation", 0);
3843 
3844  /* "superluWrappers.pyx":70
3845  * (rowptr, colptr, vals)
3846  * """
3847  * return (self.rowptr, self.colind, self.nzvals) # <<<<<<<<<<<<<<
3848  *
3849  * def getSubMatCSRrepresentation(self,
3850  */
3851  __Pyx_XDECREF(__pyx_r);
3852  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
3853  __Pyx_GOTREF(__pyx_t_1);
3854  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
3855  __Pyx_GOTREF(__pyx_t_2);
3856  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error)
3857  __Pyx_GOTREF(__pyx_t_3);
3858  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error)
3859  __Pyx_GOTREF(__pyx_t_4);
3860  __Pyx_GIVEREF(__pyx_t_1);
3861  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
3862  __Pyx_GIVEREF(__pyx_t_2);
3863  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
3864  __Pyx_GIVEREF(__pyx_t_3);
3865  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
3866  __pyx_t_1 = 0;
3867  __pyx_t_2 = 0;
3868  __pyx_t_3 = 0;
3869  __pyx_r = __pyx_t_4;
3870  __pyx_t_4 = 0;
3871  goto __pyx_L0;
3872 
3873  /* "superluWrappers.pyx":62
3874  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3875  *
3876  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
3877  * """ Get the CSR representation of the sparse matrix.
3878  *
3879  */
3880 
3881  /* function exit code */
3882  __pyx_L1_error:;
3883  __Pyx_XDECREF(__pyx_t_1);
3884  __Pyx_XDECREF(__pyx_t_2);
3885  __Pyx_XDECREF(__pyx_t_3);
3886  __Pyx_XDECREF(__pyx_t_4);
3887  __Pyx_AddTraceback("superluWrappers.SparseMatrix.getCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
3888  __pyx_r = NULL;
3889  __pyx_L0:;
3890  __Pyx_XGIVEREF(__pyx_r);
3891  __Pyx_RefNannyFinishContext();
3892  return __pyx_r;
3893 }
3894 
3895 /* "superluWrappers.pyx":72
3896  * return (self.rowptr, self.colind, self.nzvals)
3897  *
3898  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
3899  * range_start,
3900  * range_end):
3901  */
3902 
3903 /* Python wrapper */
3904 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3905 static char __pyx_doc_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation[] = " Get the CSR representation for a submatrix.\n\n Arguments\n ---------\n range_start : int\n range_end : int\n\n Returns\n -------\n csr_data : tuple of nparray\n (rowptr, colind, nzvals)\n ";
3906 static PyMethodDef __pyx_mdef_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation = {"getSubMatCSRrepresentation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation};
3907 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3908  PyObject *__pyx_v_self = 0;
3909  PyObject *__pyx_v_range_start = 0;
3910  PyObject *__pyx_v_range_end = 0;
3911  PyObject *__pyx_r = 0;
3912  __Pyx_RefNannyDeclarations
3913  __Pyx_RefNannySetupContext("getSubMatCSRrepresentation (wrapper)", 0);
3914  {
3915  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_range_start,&__pyx_n_s_range_end,0};
3916  PyObject* values[3] = {0,0,0};
3917  if (unlikely(__pyx_kwds)) {
3918  Py_ssize_t kw_args;
3919  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3920  switch (pos_args) {
3921  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3922  CYTHON_FALLTHROUGH;
3923  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3924  CYTHON_FALLTHROUGH;
3925  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3926  CYTHON_FALLTHROUGH;
3927  case 0: break;
3928  default: goto __pyx_L5_argtuple_error;
3929  }
3930  kw_args = PyDict_Size(__pyx_kwds);
3931  switch (pos_args) {
3932  case 0:
3933  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3934  else goto __pyx_L5_argtuple_error;
3935  CYTHON_FALLTHROUGH;
3936  case 1:
3937  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_range_start)) != 0)) kw_args--;
3938  else {
3939  __Pyx_RaiseArgtupleInvalid("getSubMatCSRrepresentation", 1, 3, 3, 1); __PYX_ERR(0, 72, __pyx_L3_error)
3940  }
3941  CYTHON_FALLTHROUGH;
3942  case 2:
3943  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_range_end)) != 0)) kw_args--;
3944  else {
3945  __Pyx_RaiseArgtupleInvalid("getSubMatCSRrepresentation", 1, 3, 3, 2); __PYX_ERR(0, 72, __pyx_L3_error)
3946  }
3947  }
3948  if (unlikely(kw_args > 0)) {
3949  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getSubMatCSRrepresentation") < 0)) __PYX_ERR(0, 72, __pyx_L3_error)
3950  }
3951  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3952  goto __pyx_L5_argtuple_error;
3953  } else {
3954  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3955  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3956  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3957  }
3958  __pyx_v_self = values[0];
3959  __pyx_v_range_start = values[1];
3960  __pyx_v_range_end = values[2];
3961  }
3962  goto __pyx_L4_argument_unpacking_done;
3963  __pyx_L5_argtuple_error:;
3964  __Pyx_RaiseArgtupleInvalid("getSubMatCSRrepresentation", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 72, __pyx_L3_error)
3965  __pyx_L3_error:;
3966  __Pyx_AddTraceback("superluWrappers.SparseMatrix.getSubMatCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
3967  __Pyx_RefNannyFinishContext();
3968  return NULL;
3969  __pyx_L4_argument_unpacking_done:;
3970  __pyx_r = __pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(__pyx_self, __pyx_v_self, __pyx_v_range_start, __pyx_v_range_end);
3971 
3972  /* function exit code */
3973  __Pyx_RefNannyFinishContext();
3974  return __pyx_r;
3975 }
3976 
3977 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_8getSubMatCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_range_start, PyObject *__pyx_v_range_end) {
3978  PyObject *__pyx_v__rows = NULL;
3979  PyObject *__pyx_v_nnz = NULL;
3980  PyObject *__pyx_v_rowptr = NULL;
3981  PyObject *__pyx_v_colind = NULL;
3982  PyObject *__pyx_v_nzvals = NULL;
3983  PyObject *__pyx_r = NULL;
3984  __Pyx_RefNannyDeclarations
3985  PyObject *__pyx_t_1 = NULL;
3986  int __pyx_t_2;
3987  PyObject *__pyx_t_3 = NULL;
3988  PyObject *__pyx_t_4 = NULL;
3989  PyObject *__pyx_t_5 = NULL;
3990  __Pyx_RefNannySetupContext("getSubMatCSRrepresentation", 0);
3991 
3992  /* "superluWrappers.pyx":87
3993  * (rowptr, colind, nzvals)
3994  * """
3995  * assert range_start >= 0 ; assert range_end <= self.nr # <<<<<<<<<<<<<<
3996  * assert range_end > range_start
3997  * _rows = range_end - range_start
3998  */
3999  #ifndef CYTHON_WITHOUT_ASSERTIONS
4000  if (unlikely(!Py_OptimizeFlag)) {
4001  __pyx_t_1 = PyObject_RichCompare(__pyx_v_range_start, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
4002  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 87, __pyx_L1_error)
4003  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4004  if (unlikely(!__pyx_t_2)) {
4005  PyErr_SetNone(PyExc_AssertionError);
4006  __PYX_ERR(0, 87, __pyx_L1_error)
4007  }
4008  }
4009  #endif
4010  #ifndef CYTHON_WITHOUT_ASSERTIONS
4011  if (unlikely(!Py_OptimizeFlag)) {
4012  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
4013  __Pyx_GOTREF(__pyx_t_1);
4014  __pyx_t_3 = PyObject_RichCompare(__pyx_v_range_end, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error)
4015  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4016  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 87, __pyx_L1_error)
4017  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4018  if (unlikely(!__pyx_t_2)) {
4019  PyErr_SetNone(PyExc_AssertionError);
4020  __PYX_ERR(0, 87, __pyx_L1_error)
4021  }
4022  }
4023  #endif
4024 
4025  /* "superluWrappers.pyx":88
4026  * """
4027  * assert range_start >= 0 ; assert range_end <= self.nr
4028  * assert range_end > range_start # <<<<<<<<<<<<<<
4029  * _rows = range_end - range_start
4030  * assert _rows <= self.nr
4031  */
4032  #ifndef CYTHON_WITHOUT_ASSERTIONS
4033  if (unlikely(!Py_OptimizeFlag)) {
4034  __pyx_t_3 = PyObject_RichCompare(__pyx_v_range_end, __pyx_v_range_start, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
4035  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 88, __pyx_L1_error)
4036  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4037  if (unlikely(!__pyx_t_2)) {
4038  PyErr_SetNone(PyExc_AssertionError);
4039  __PYX_ERR(0, 88, __pyx_L1_error)
4040  }
4041  }
4042  #endif
4043 
4044  /* "superluWrappers.pyx":89
4045  * assert range_start >= 0 ; assert range_end <= self.nr
4046  * assert range_end > range_start
4047  * _rows = range_end - range_start # <<<<<<<<<<<<<<
4048  * assert _rows <= self.nr
4049  *
4050  */
4051  __pyx_t_3 = PyNumber_Subtract(__pyx_v_range_end, __pyx_v_range_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
4052  __Pyx_GOTREF(__pyx_t_3);
4053  __pyx_v__rows = __pyx_t_3;
4054  __pyx_t_3 = 0;
4055 
4056  /* "superluWrappers.pyx":90
4057  * assert range_end > range_start
4058  * _rows = range_end - range_start
4059  * assert _rows <= self.nr # <<<<<<<<<<<<<<
4060  *
4061  * nnz = self.rowptr[range_end] - self.rowptr[range_start]
4062  */
4063  #ifndef CYTHON_WITHOUT_ASSERTIONS
4064  if (unlikely(!Py_OptimizeFlag)) {
4065  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error)
4066  __Pyx_GOTREF(__pyx_t_3);
4067  __pyx_t_1 = PyObject_RichCompare(__pyx_v__rows, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
4068  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4069  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 90, __pyx_L1_error)
4070  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4071  if (unlikely(!__pyx_t_2)) {
4072  PyErr_SetNone(PyExc_AssertionError);
4073  __PYX_ERR(0, 90, __pyx_L1_error)
4074  }
4075  }
4076  #endif
4077 
4078  /* "superluWrappers.pyx":92
4079  * assert _rows <= self.nr
4080  *
4081  * nnz = self.rowptr[range_end] - self.rowptr[range_start] # <<<<<<<<<<<<<<
4082  *
4083  * rowptr = self.rowptr[range_start : range_start + _rows + 1]
4084  */
4085  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
4086  __Pyx_GOTREF(__pyx_t_1);
4087  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_range_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error)
4088  __Pyx_GOTREF(__pyx_t_3);
4089  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4090  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
4091  __Pyx_GOTREF(__pyx_t_1);
4092  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_range_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
4093  __Pyx_GOTREF(__pyx_t_4);
4094  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4095  __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
4096  __Pyx_GOTREF(__pyx_t_1);
4097  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4098  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4099  __pyx_v_nnz = __pyx_t_1;
4100  __pyx_t_1 = 0;
4101 
4102  /* "superluWrappers.pyx":94
4103  * nnz = self.rowptr[range_end] - self.rowptr[range_start]
4104  *
4105  * rowptr = self.rowptr[range_start : range_start + _rows + 1] # <<<<<<<<<<<<<<
4106  * colind = self.colind[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4107  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4108  */
4109  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
4110  __Pyx_GOTREF(__pyx_t_1);
4111  __pyx_t_4 = PyNumber_Add(__pyx_v_range_start, __pyx_v__rows); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
4112  __Pyx_GOTREF(__pyx_t_4);
4113  __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
4114  __Pyx_GOTREF(__pyx_t_3);
4115  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4116  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 0, &__pyx_v_range_start, &__pyx_t_3, NULL, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
4117  __Pyx_GOTREF(__pyx_t_4);
4118  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4119  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4120  __pyx_v_rowptr = __pyx_t_4;
4121  __pyx_t_4 = 0;
4122 
4123  /* "superluWrappers.pyx":95
4124  *
4125  * rowptr = self.rowptr[range_start : range_start + _rows + 1]
4126  * colind = self.colind[self.rowptr[range_start] : self.rowptr[range_start] + nnz] # <<<<<<<<<<<<<<
4127  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4128  *
4129  */
4130  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_colind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
4131  __Pyx_GOTREF(__pyx_t_4);
4132  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
4133  __Pyx_GOTREF(__pyx_t_3);
4134  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
4135  __Pyx_GOTREF(__pyx_t_1);
4136  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4137  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
4138  __Pyx_GOTREF(__pyx_t_3);
4139  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
4140  __Pyx_GOTREF(__pyx_t_5);
4141  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4142  __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_v_nnz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
4143  __Pyx_GOTREF(__pyx_t_3);
4144  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4145  __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, &__pyx_t_1, &__pyx_t_3, NULL, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
4146  __Pyx_GOTREF(__pyx_t_5);
4147  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4148  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4149  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4150  __pyx_v_colind = __pyx_t_5;
4151  __pyx_t_5 = 0;
4152 
4153  /* "superluWrappers.pyx":96
4154  * rowptr = self.rowptr[range_start : range_start + _rows + 1]
4155  * colind = self.colind[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4156  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz] # <<<<<<<<<<<<<<
4157  *
4158  * return rowptr, colind, nzvals
4159  */
4160  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nzvals); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
4161  __Pyx_GOTREF(__pyx_t_5);
4162  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
4163  __Pyx_GOTREF(__pyx_t_3);
4164  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
4165  __Pyx_GOTREF(__pyx_t_1);
4166  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4167  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
4168  __Pyx_GOTREF(__pyx_t_3);
4169  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_range_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
4170  __Pyx_GOTREF(__pyx_t_4);
4171  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4172  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_v_nnz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
4173  __Pyx_GOTREF(__pyx_t_3);
4174  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4175  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_5, 0, 0, &__pyx_t_1, &__pyx_t_3, NULL, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
4176  __Pyx_GOTREF(__pyx_t_4);
4177  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4178  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4179  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4180  __pyx_v_nzvals = __pyx_t_4;
4181  __pyx_t_4 = 0;
4182 
4183  /* "superluWrappers.pyx":98
4184  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4185  *
4186  * return rowptr, colind, nzvals # <<<<<<<<<<<<<<
4187  *
4188  * cdef class cSparseMatrix(object):
4189  */
4190  __Pyx_XDECREF(__pyx_r);
4191  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error)
4192  __Pyx_GOTREF(__pyx_t_4);
4193  __Pyx_INCREF(__pyx_v_rowptr);
4194  __Pyx_GIVEREF(__pyx_v_rowptr);
4195  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_rowptr);
4196  __Pyx_INCREF(__pyx_v_colind);
4197  __Pyx_GIVEREF(__pyx_v_colind);
4198  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_colind);
4199  __Pyx_INCREF(__pyx_v_nzvals);
4200  __Pyx_GIVEREF(__pyx_v_nzvals);
4201  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_nzvals);
4202  __pyx_r = __pyx_t_4;
4203  __pyx_t_4 = 0;
4204  goto __pyx_L0;
4205 
4206  /* "superluWrappers.pyx":72
4207  * return (self.rowptr, self.colind, self.nzvals)
4208  *
4209  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
4210  * range_start,
4211  * range_end):
4212  */
4213 
4214  /* function exit code */
4215  __pyx_L1_error:;
4216  __Pyx_XDECREF(__pyx_t_1);
4217  __Pyx_XDECREF(__pyx_t_3);
4218  __Pyx_XDECREF(__pyx_t_4);
4219  __Pyx_XDECREF(__pyx_t_5);
4220  __Pyx_AddTraceback("superluWrappers.SparseMatrix.getSubMatCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
4221  __pyx_r = NULL;
4222  __pyx_L0:;
4223  __Pyx_XDECREF(__pyx_v__rows);
4224  __Pyx_XDECREF(__pyx_v_nnz);
4225  __Pyx_XDECREF(__pyx_v_rowptr);
4226  __Pyx_XDECREF(__pyx_v_colind);
4227  __Pyx_XDECREF(__pyx_v_nzvals);
4228  __Pyx_XGIVEREF(__pyx_r);
4229  __Pyx_RefNannyFinishContext();
4230  return __pyx_r;
4231 }
4232 
4233 /* "superluWrappers.pyx":102
4234  * cdef class cSparseMatrix(object):
4235  *
4236  * def __cinit__(self, # <<<<<<<<<<<<<<
4237  * int nr,
4238  * int nc,
4239  */
4240 
4241 /* Python wrapper */
4242 static int __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4243 static int __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4244  int __pyx_v_nr;
4245  int __pyx_v_nc;
4246  int __pyx_v_nnz;
4247  __Pyx_memviewslice __pyx_v_nzval = { 0, 0, { 0 }, { 0 }, { 0 } };
4248  __Pyx_memviewslice __pyx_v_colind = { 0, 0, { 0 }, { 0 }, { 0 } };
4249  __Pyx_memviewslice __pyx_v_rowptr = { 0, 0, { 0 }, { 0 }, { 0 } };
4250  int __pyx_r;
4251  __Pyx_RefNannyDeclarations
4252  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
4253  {
4254  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nr,&__pyx_n_s_nc,&__pyx_n_s_nnz,&__pyx_n_s_nzval,&__pyx_n_s_colind,&__pyx_n_s_rowptr,0};
4255  PyObject* values[6] = {0,0,0,0,0,0};
4256  if (unlikely(__pyx_kwds)) {
4257  Py_ssize_t kw_args;
4258  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4259  switch (pos_args) {
4260  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4261  CYTHON_FALLTHROUGH;
4262  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4263  CYTHON_FALLTHROUGH;
4264  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4265  CYTHON_FALLTHROUGH;
4266  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4267  CYTHON_FALLTHROUGH;
4268  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4269  CYTHON_FALLTHROUGH;
4270  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4271  CYTHON_FALLTHROUGH;
4272  case 0: break;
4273  default: goto __pyx_L5_argtuple_error;
4274  }
4275  kw_args = PyDict_Size(__pyx_kwds);
4276  switch (pos_args) {
4277  case 0:
4278  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nr)) != 0)) kw_args--;
4279  else goto __pyx_L5_argtuple_error;
4280  CYTHON_FALLTHROUGH;
4281  case 1:
4282  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--;
4283  else {
4284  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 1); __PYX_ERR(0, 102, __pyx_L3_error)
4285  }
4286  CYTHON_FALLTHROUGH;
4287  case 2:
4288  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
4289  else {
4290  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 2); __PYX_ERR(0, 102, __pyx_L3_error)
4291  }
4292  CYTHON_FALLTHROUGH;
4293  case 3:
4294  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nzval)) != 0)) kw_args--;
4295  else {
4296  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 3); __PYX_ERR(0, 102, __pyx_L3_error)
4297  }
4298  CYTHON_FALLTHROUGH;
4299  case 4:
4300  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
4301  else {
4302  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 4); __PYX_ERR(0, 102, __pyx_L3_error)
4303  }
4304  CYTHON_FALLTHROUGH;
4305  case 5:
4306  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
4307  else {
4308  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 5); __PYX_ERR(0, 102, __pyx_L3_error)
4309  }
4310  }
4311  if (unlikely(kw_args > 0)) {
4312  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 102, __pyx_L3_error)
4313  }
4314  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4315  goto __pyx_L5_argtuple_error;
4316  } else {
4317  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4318  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4319  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4320  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4321  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4322  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4323  }
4324  __pyx_v_nr = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_nr == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error)
4325  __pyx_v_nc = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nc == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error)
4326  __pyx_v_nnz = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nnz == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error)
4327  __pyx_v_nzval = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_nzval.memview)) __PYX_ERR(0, 106, __pyx_L3_error)
4328  __pyx_v_colind = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_colind.memview)) __PYX_ERR(0, 107, __pyx_L3_error)
4329  __pyx_v_rowptr = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_rowptr.memview)) __PYX_ERR(0, 108, __pyx_L3_error)
4330  }
4331  goto __pyx_L4_argument_unpacking_done;
4332  __pyx_L5_argtuple_error:;
4333  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 102, __pyx_L3_error)
4334  __pyx_L3_error:;
4335  __Pyx_AddTraceback("superluWrappers.cSparseMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4336  __Pyx_RefNannyFinishContext();
4337  return -1;
4338  __pyx_L4_argument_unpacking_done:;
4339  __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self), __pyx_v_nr, __pyx_v_nc, __pyx_v_nnz, __pyx_v_nzval, __pyx_v_colind, __pyx_v_rowptr);
4340 
4341  /* function exit code */
4342  __Pyx_RefNannyFinishContext();
4343  return __pyx_r;
4344 }
4345 
4346 static int __pyx_pf_15superluWrappers_13cSparseMatrix___cinit__(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, int __pyx_v_nr, int __pyx_v_nc, int __pyx_v_nnz, __Pyx_memviewslice __pyx_v_nzval, __Pyx_memviewslice __pyx_v_colind, __Pyx_memviewslice __pyx_v_rowptr) {
4347  int __pyx_r;
4348  __Pyx_RefNannyDeclarations
4349  Py_ssize_t __pyx_t_1;
4350  Py_ssize_t __pyx_t_2;
4351  Py_ssize_t __pyx_t_3;
4352  __Pyx_RefNannySetupContext("__cinit__", 0);
4353 
4354  /* "superluWrappers.pyx":109
4355  * np.int32_t [:] colind,
4356  * np.int32_t [:] rowptr):
4357  * self.dim[0] = nr ; self.dim[1] = nc # <<<<<<<<<<<<<<
4358  * self.A.nnz = nnz
4359  * #ARB - should memory for these ptrs need be allocated?
4360  */
4361  (__pyx_v_self->dim[0]) = __pyx_v_nr;
4362  (__pyx_v_self->dim[1]) = __pyx_v_nc;
4363 
4364  /* "superluWrappers.pyx":110
4365  * np.int32_t [:] rowptr):
4366  * self.dim[0] = nr ; self.dim[1] = nc
4367  * self.A.nnz = nnz # <<<<<<<<<<<<<<
4368  * #ARB - should memory for these ptrs need be allocated?
4369  * self.A.nzval = &nzval[0]
4370  */
4371  __pyx_v_self->A.nnz = __pyx_v_nnz;
4372 
4373  /* "superluWrappers.pyx":112
4374  * self.A.nnz = nnz
4375  * #ARB - should memory for these ptrs need be allocated?
4376  * self.A.nzval = &nzval[0] # <<<<<<<<<<<<<<
4377  * self.A.colind = &colind[0]
4378  * self.A.rowptr = &rowptr[0]
4379  */
4380  __pyx_t_1 = 0;
4381  __pyx_v_self->A.nzval = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_nzval.data + __pyx_t_1 * __pyx_v_nzval.strides[0]) ))));
4382 
4383  /* "superluWrappers.pyx":113
4384  * #ARB - should memory for these ptrs need be allocated?
4385  * self.A.nzval = &nzval[0]
4386  * self.A.colind = &colind[0] # <<<<<<<<<<<<<<
4387  * self.A.rowptr = &rowptr[0]
4388  *
4389  */
4390  __pyx_t_2 = 0;
4391  __pyx_v_self->A.colind = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_colind.data + __pyx_t_2 * __pyx_v_colind.strides[0]) ))));
4392 
4393  /* "superluWrappers.pyx":114
4394  * self.A.nzval = &nzval[0]
4395  * self.A.colind = &colind[0]
4396  * self.A.rowptr = &rowptr[0] # <<<<<<<<<<<<<<
4397  *
4398  * cdef void SparseMatrix_matvec(cSparseMatrix sm,
4399  */
4400  __pyx_t_3 = 0;
4401  __pyx_v_self->A.rowptr = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_rowptr.data + __pyx_t_3 * __pyx_v_rowptr.strides[0]) ))));
4402 
4403  /* "superluWrappers.pyx":102
4404  * cdef class cSparseMatrix(object):
4405  *
4406  * def __cinit__(self, # <<<<<<<<<<<<<<
4407  * int nr,
4408  * int nc,
4409  */
4410 
4411  /* function exit code */
4412  __pyx_r = 0;
4413  __PYX_XDEC_MEMVIEW(&__pyx_v_nzval, 1);
4414  __PYX_XDEC_MEMVIEW(&__pyx_v_colind, 1);
4415  __PYX_XDEC_MEMVIEW(&__pyx_v_rowptr, 1);
4416  __Pyx_RefNannyFinishContext();
4417  return __pyx_r;
4418 }
4419 
4420 /* "(tree fragment)":1
4421  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4422  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4423  * def __setstate_cython__(self, __pyx_state):
4424  */
4425 
4426 /* Python wrapper */
4427 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4428 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4429  PyObject *__pyx_r = 0;
4430  __Pyx_RefNannyDeclarations
4431  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4432  __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self));
4433 
4434  /* function exit code */
4435  __Pyx_RefNannyFinishContext();
4436  return __pyx_r;
4437 }
4438 
4439 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self) {
4440  PyObject *__pyx_r = NULL;
4441  __Pyx_RefNannyDeclarations
4442  PyObject *__pyx_t_1 = NULL;
4443  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4444 
4445  /* "(tree fragment)":2
4446  * def __reduce_cython__(self):
4447  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4448  * def __setstate_cython__(self, __pyx_state):
4449  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4450  */
4451  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
4452  __Pyx_GOTREF(__pyx_t_1);
4453  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4454  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4455  __PYX_ERR(1, 2, __pyx_L1_error)
4456 
4457  /* "(tree fragment)":1
4458  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4459  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4460  * def __setstate_cython__(self, __pyx_state):
4461  */
4462 
4463  /* function exit code */
4464  __pyx_L1_error:;
4465  __Pyx_XDECREF(__pyx_t_1);
4466  __Pyx_AddTraceback("superluWrappers.cSparseMatrix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4467  __pyx_r = NULL;
4468  __Pyx_XGIVEREF(__pyx_r);
4469  __Pyx_RefNannyFinishContext();
4470  return __pyx_r;
4471 }
4472 
4473 /* "(tree fragment)":3
4474  * def __reduce_cython__(self):
4475  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4476  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4477  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4478  */
4479 
4480 /* Python wrapper */
4481 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
4482 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4483  PyObject *__pyx_r = 0;
4484  __Pyx_RefNannyDeclarations
4485  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4486  __pyx_r = __pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4487 
4488  /* function exit code */
4489  __Pyx_RefNannyFinishContext();
4490  return __pyx_r;
4491 }
4492 
4493 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
4494  PyObject *__pyx_r = NULL;
4495  __Pyx_RefNannyDeclarations
4496  PyObject *__pyx_t_1 = NULL;
4497  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4498 
4499  /* "(tree fragment)":4
4500  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4501  * def __setstate_cython__(self, __pyx_state):
4502  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4503  */
4504  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
4505  __Pyx_GOTREF(__pyx_t_1);
4506  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4507  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4508  __PYX_ERR(1, 4, __pyx_L1_error)
4509 
4510  /* "(tree fragment)":3
4511  * def __reduce_cython__(self):
4512  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4513  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4514  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4515  */
4516 
4517  /* function exit code */
4518  __pyx_L1_error:;
4519  __Pyx_XDECREF(__pyx_t_1);
4520  __Pyx_AddTraceback("superluWrappers.cSparseMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4521  __pyx_r = NULL;
4522  __Pyx_XGIVEREF(__pyx_r);
4523  __Pyx_RefNannyFinishContext();
4524  return __pyx_r;
4525 }
4526 
4527 /* "superluWrappers.pyx":116
4528  * self.A.rowptr = &rowptr[0]
4529  *
4530  * cdef void SparseMatrix_matvec(cSparseMatrix sm, # <<<<<<<<<<<<<<
4531  * np.float64_t [:] xp,
4532  * np.float64_t [:] yp):
4533  */
4534 
4535 static void __pyx_f_15superluWrappers_SparseMatrix_matvec(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_sm, __Pyx_memviewslice __pyx_v_xp, __Pyx_memviewslice __pyx_v_yp) {
4536  __pyx_t_5numpy_float64_t __pyx_v_tmp;
4537  int __pyx_v_i;
4538  int __pyx_v_k;
4539  __Pyx_RefNannyDeclarations
4540  __pyx_t_5numpy_int32_t __pyx_t_1;
4541  __pyx_t_5numpy_int32_t __pyx_t_2;
4542  int __pyx_t_3;
4543  __pyx_t_5numpy_int32_t __pyx_t_4;
4544  __pyx_t_5numpy_int32_t __pyx_t_5;
4545  int __pyx_t_6;
4546  Py_ssize_t __pyx_t_7;
4547  Py_ssize_t __pyx_t_8;
4548  __Pyx_RefNannySetupContext("SparseMatrix_matvec", 0);
4549 
4550  /* "superluWrappers.pyx":119
4551  * np.float64_t [:] xp,
4552  * np.float64_t [:] yp):
4553  * cdef np.float64_t tmp = 0. # <<<<<<<<<<<<<<
4554  * cdef int i, k
4555  *
4556  */
4557  __pyx_v_tmp = 0.;
4558 
4559  /* "superluWrappers.pyx":122
4560  * cdef int i, k
4561  *
4562  * for i in range(sm.dim[0]): # <<<<<<<<<<<<<<
4563  * tmp = 0.
4564  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4565  */
4566  __pyx_t_1 = (__pyx_v_sm->dim[0]);
4567  __pyx_t_2 = __pyx_t_1;
4568  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4569  __pyx_v_i = __pyx_t_3;
4570 
4571  /* "superluWrappers.pyx":123
4572  *
4573  * for i in range(sm.dim[0]):
4574  * tmp = 0. # <<<<<<<<<<<<<<
4575  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4576  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]]
4577  */
4578  __pyx_v_tmp = 0.;
4579 
4580  /* "superluWrappers.pyx":124
4581  * for i in range(sm.dim[0]):
4582  * tmp = 0.
4583  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]): # <<<<<<<<<<<<<<
4584  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]]
4585  * yp[i] = tmp
4586  */
4587  __pyx_t_4 = (__pyx_v_sm->A.rowptr[(__pyx_v_i + 1)]);
4588  __pyx_t_5 = __pyx_t_4;
4589  for (__pyx_t_6 = (__pyx_v_sm->A.rowptr[__pyx_v_i]); __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
4590  __pyx_v_k = __pyx_t_6;
4591 
4592  /* "superluWrappers.pyx":125
4593  * tmp = 0.
4594  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4595  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]] # <<<<<<<<<<<<<<
4596  * yp[i] = tmp
4597  *
4598  */
4599  __pyx_t_7 = (__pyx_v_sm->A.colind[__pyx_v_k]);
4600  __pyx_v_tmp = (__pyx_v_tmp + ((__pyx_v_sm->A.nzval[__pyx_v_k]) * (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_xp.data + __pyx_t_7 * __pyx_v_xp.strides[0]) )))));
4601  }
4602 
4603  /* "superluWrappers.pyx":126
4604  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4605  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]]
4606  * yp[i] = tmp # <<<<<<<<<<<<<<
4607  *
4608  * cdef struct _NCformat:
4609  */
4610  __pyx_t_8 = __pyx_v_i;
4611  *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_yp.data + __pyx_t_8 * __pyx_v_yp.strides[0]) )) = __pyx_v_tmp;
4612  }
4613 
4614  /* "superluWrappers.pyx":116
4615  * self.A.rowptr = &rowptr[0]
4616  *
4617  * cdef void SparseMatrix_matvec(cSparseMatrix sm, # <<<<<<<<<<<<<<
4618  * np.float64_t [:] xp,
4619  * np.float64_t [:] yp):
4620  */
4621 
4622  /* function exit code */
4623  __Pyx_RefNannyFinishContext();
4624 }
4625 
4626 /* "superluWrappers.pyx":170
4627  * cdef public int dim
4628  *
4629  * def __init__(self, dim): # <<<<<<<<<<<<<<
4630  * """
4631  * Arguments
4632  */
4633 
4634 /* Python wrapper */
4635 static int __pyx_pw_15superluWrappers_12SparseFactor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4636 static char __pyx_doc_15superluWrappers_12SparseFactor___init__[] = "\n Arguments\n ---------\n dim : int\n Dimension of the sparse factor.\n ";
4637 #if CYTHON_COMPILING_IN_CPYTHON
4638 struct wrapperbase __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__;
4639 #endif
4640 static int __pyx_pw_15superluWrappers_12SparseFactor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4641  PyObject *__pyx_v_dim = 0;
4642  int __pyx_r;
4643  __Pyx_RefNannyDeclarations
4644  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
4645  {
4646  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,0};
4647  PyObject* values[1] = {0};
4648  if (unlikely(__pyx_kwds)) {
4649  Py_ssize_t kw_args;
4650  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4651  switch (pos_args) {
4652  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4653  CYTHON_FALLTHROUGH;
4654  case 0: break;
4655  default: goto __pyx_L5_argtuple_error;
4656  }
4657  kw_args = PyDict_Size(__pyx_kwds);
4658  switch (pos_args) {
4659  case 0:
4660  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim)) != 0)) kw_args--;
4661  else goto __pyx_L5_argtuple_error;
4662  }
4663  if (unlikely(kw_args > 0)) {
4664  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 170, __pyx_L3_error)
4665  }
4666  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
4667  goto __pyx_L5_argtuple_error;
4668  } else {
4669  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4670  }
4671  __pyx_v_dim = values[0];
4672  }
4673  goto __pyx_L4_argument_unpacking_done;
4674  __pyx_L5_argtuple_error:;
4675  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 170, __pyx_L3_error)
4676  __pyx_L3_error:;
4677  __Pyx_AddTraceback("superluWrappers.SparseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4678  __Pyx_RefNannyFinishContext();
4679  return -1;
4680  __pyx_L4_argument_unpacking_done:;
4681  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor___init__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), __pyx_v_dim);
4682 
4683  /* function exit code */
4684  __Pyx_RefNannyFinishContext();
4685  return __pyx_r;
4686 }
4687 
4688 static int __pyx_pf_15superluWrappers_12SparseFactor___init__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_dim) {
4689  int __pyx_r;
4690  __Pyx_RefNannyDeclarations
4691  PyObject *__pyx_t_1 = NULL;
4692  int __pyx_t_2;
4693  __pyx_t_5numpy_int32_t __pyx_t_3;
4694  PyObject *__pyx_t_4 = NULL;
4695  size_t __pyx_t_5;
4696  __Pyx_RefNannySetupContext("__init__", 0);
4697 
4698  /* "superluWrappers.pyx":177
4699  * Dimension of the sparse factor.
4700  * """
4701  * cStatInit(&self.stat) # <<<<<<<<<<<<<<
4702  * cset_default_options(&self.options)
4703  * self._set_mat_types()
4704  */
4705  StatInit((&__pyx_v_self->stat));
4706 
4707  /* "superluWrappers.pyx":178
4708  * """
4709  * cStatInit(&self.stat)
4710  * cset_default_options(&self.options) # <<<<<<<<<<<<<<
4711  * self._set_mat_types()
4712  * self.dim = dim
4713  */
4714  set_default_options((&__pyx_v_self->options));
4715 
4716  /* "superluWrappers.pyx":179
4717  * cStatInit(&self.stat)
4718  * cset_default_options(&self.options)
4719  * self._set_mat_types() # <<<<<<<<<<<<<<
4720  * self.dim = dim
4721  * self.A.nrow = dim ; self.A.ncol = dim
4722  */
4723  __pyx_t_1 = ((struct __pyx_vtabstruct_15superluWrappers_SparseFactor *)__pyx_v_self->__pyx_vtab)->_set_mat_types(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
4724  __Pyx_GOTREF(__pyx_t_1);
4725  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4726 
4727  /* "superluWrappers.pyx":180
4728  * cset_default_options(&self.options)
4729  * self._set_mat_types()
4730  * self.dim = dim # <<<<<<<<<<<<<<
4731  * self.A.nrow = dim ; self.A.ncol = dim
4732  * self.AC.nrow = dim ; self.AC.ncol = dim
4733  */
4734  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error)
4735  __pyx_v_self->dim = __pyx_t_2;
4736 
4737  /* "superluWrappers.pyx":181
4738  * self._set_mat_types()
4739  * self.dim = dim
4740  * self.A.nrow = dim ; self.A.ncol = dim # <<<<<<<<<<<<<<
4741  * self.AC.nrow = dim ; self.AC.ncol = dim
4742  * self.L.nrow = dim ; self.L.ncol = dim
4743  */
4744  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
4745  __pyx_v_self->A.nrow = __pyx_t_2;
4746  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
4747  __pyx_v_self->A.ncol = __pyx_t_2;
4748 
4749  /* "superluWrappers.pyx":182
4750  * self.dim = dim
4751  * self.A.nrow = dim ; self.A.ncol = dim
4752  * self.AC.nrow = dim ; self.AC.ncol = dim # <<<<<<<<<<<<<<
4753  * self.L.nrow = dim ; self.L.ncol = dim
4754  * self.U.nrow = dim ; self.U.ncol = dim
4755  */
4756  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error)
4757  __pyx_v_self->AC.nrow = __pyx_t_2;
4758  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error)
4759  __pyx_v_self->AC.ncol = __pyx_t_2;
4760 
4761  /* "superluWrappers.pyx":183
4762  * self.A.nrow = dim ; self.A.ncol = dim
4763  * self.AC.nrow = dim ; self.AC.ncol = dim
4764  * self.L.nrow = dim ; self.L.ncol = dim # <<<<<<<<<<<<<<
4765  * self.U.nrow = dim ; self.U.ncol = dim
4766  * self.X.nrow = dim ; self.X.ncol = 1
4767  */
4768  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error)
4769  __pyx_v_self->L.nrow = __pyx_t_2;
4770  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L1_error)
4771  __pyx_v_self->L.ncol = __pyx_t_2;
4772 
4773  /* "superluWrappers.pyx":184
4774  * self.AC.nrow = dim ; self.AC.ncol = dim
4775  * self.L.nrow = dim ; self.L.ncol = dim
4776  * self.U.nrow = dim ; self.U.ncol = dim # <<<<<<<<<<<<<<
4777  * self.X.nrow = dim ; self.X.ncol = 1
4778  * self.storeX.lda = dim
4779  */
4780  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
4781  __pyx_v_self->U.nrow = __pyx_t_2;
4782  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 184, __pyx_L1_error)
4783  __pyx_v_self->U.ncol = __pyx_t_2;
4784 
4785  /* "superluWrappers.pyx":185
4786  * self.L.nrow = dim ; self.L.ncol = dim
4787  * self.U.nrow = dim ; self.U.ncol = dim
4788  * self.X.nrow = dim ; self.X.ncol = 1 # <<<<<<<<<<<<<<
4789  * self.storeX.lda = dim
4790  * self.use_same_perm_c = 0
4791  */
4792  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_dim); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
4793  __pyx_v_self->X.nrow = __pyx_t_2;
4794  __pyx_v_self->X.ncol = 1;
4795 
4796  /* "superluWrappers.pyx":186
4797  * self.U.nrow = dim ; self.U.ncol = dim
4798  * self.X.nrow = dim ; self.X.ncol = 1
4799  * self.storeX.lda = dim # <<<<<<<<<<<<<<
4800  * self.use_same_perm_c = 0
4801  * self.use_same_sparsity = 0
4802  */
4803  __pyx_t_3 = __Pyx_PyInt_As_npy_int32(__pyx_v_dim); if (unlikely((__pyx_t_3 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
4804  __pyx_v_self->storeX.lda = __pyx_t_3;
4805 
4806  /* "superluWrappers.pyx":187
4807  * self.X.nrow = dim ; self.X.ncol = 1
4808  * self.storeX.lda = dim
4809  * self.use_same_perm_c = 0 # <<<<<<<<<<<<<<
4810  * self.use_same_sparsity = 0
4811  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
4812  */
4813  __pyx_v_self->use_same_perm_c = 0;
4814 
4815  /* "superluWrappers.pyx":188
4816  * self.storeX.lda = dim
4817  * self.use_same_perm_c = 0
4818  * self.use_same_sparsity = 0 # <<<<<<<<<<<<<<
4819  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
4820  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t))
4821  */
4822  __pyx_v_self->use_same_sparsity = 0;
4823 
4824  /* "superluWrappers.pyx":189
4825  * self.use_same_perm_c = 0
4826  * self.use_same_sparsity = 0
4827  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t)) # <<<<<<<<<<<<<<
4828  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t))
4829  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
4830  */
4831  __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(__pyx_t_5numpy_int32_t))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
4832  __Pyx_GOTREF(__pyx_t_1);
4833  __pyx_t_4 = PyNumber_Multiply(__pyx_v_dim, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
4834  __Pyx_GOTREF(__pyx_t_4);
4835  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4836  __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error)
4837  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4838  __pyx_v_self->perm_c = ((int *)malloc(__pyx_t_5));
4839 
4840  /* "superluWrappers.pyx":190
4841  * self.use_same_sparsity = 0
4842  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
4843  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t)) # <<<<<<<<<<<<<<
4844  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
4845  *
4846  */
4847  __pyx_t_4 = __Pyx_PyInt_FromSize_t((sizeof(__pyx_t_5numpy_int32_t))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
4848  __Pyx_GOTREF(__pyx_t_4);
4849  __pyx_t_1 = PyNumber_Multiply(__pyx_v_dim, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
4850  __Pyx_GOTREF(__pyx_t_1);
4851  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4852  __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 190, __pyx_L1_error)
4853  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4854  __pyx_v_self->perm_r = ((int *)malloc(__pyx_t_5));
4855 
4856  /* "superluWrappers.pyx":191
4857  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
4858  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t))
4859  * self.etree = <int *>malloc(dim*sizeof(np.int32_t)) # <<<<<<<<<<<<<<
4860  *
4861  * cdef _set_mat_types(self):
4862  */
4863  __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(__pyx_t_5numpy_int32_t))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
4864  __Pyx_GOTREF(__pyx_t_1);
4865  __pyx_t_4 = PyNumber_Multiply(__pyx_v_dim, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
4866  __Pyx_GOTREF(__pyx_t_4);
4867  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4868  __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 191, __pyx_L1_error)
4869  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4870  __pyx_v_self->etree = ((int *)malloc(__pyx_t_5));
4871 
4872  /* "superluWrappers.pyx":170
4873  * cdef public int dim
4874  *
4875  * def __init__(self, dim): # <<<<<<<<<<<<<<
4876  * """
4877  * Arguments
4878  */
4879 
4880  /* function exit code */
4881  __pyx_r = 0;
4882  goto __pyx_L0;
4883  __pyx_L1_error:;
4884  __Pyx_XDECREF(__pyx_t_1);
4885  __Pyx_XDECREF(__pyx_t_4);
4886  __Pyx_AddTraceback("superluWrappers.SparseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4887  __pyx_r = -1;
4888  __pyx_L0:;
4889  __Pyx_RefNannyFinishContext();
4890  return __pyx_r;
4891 }
4892 
4893 /* "superluWrappers.pyx":193
4894  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
4895  *
4896  * cdef _set_mat_types(self): # <<<<<<<<<<<<<<
4897  * self.A.Stype = _SLU_NC
4898  * self.A.Dtype = _SLU_D
4899  */
4900 
4901 static PyObject *__pyx_f_15superluWrappers_12SparseFactor__set_mat_types(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
4902  PyObject *__pyx_r = NULL;
4903  __Pyx_RefNannyDeclarations
4904  __Pyx_RefNannySetupContext("_set_mat_types", 0);
4905 
4906  /* "superluWrappers.pyx":194
4907  *
4908  * cdef _set_mat_types(self):
4909  * self.A.Stype = _SLU_NC # <<<<<<<<<<<<<<
4910  * self.A.Dtype = _SLU_D
4911  * self.A.Mtype = _SLU_GE
4912  */
4913  __pyx_v_self->A.Stype = SLU_NC;
4914 
4915  /* "superluWrappers.pyx":195
4916  * cdef _set_mat_types(self):
4917  * self.A.Stype = _SLU_NC
4918  * self.A.Dtype = _SLU_D # <<<<<<<<<<<<<<
4919  * self.A.Mtype = _SLU_GE
4920  * self.A.Store = &self.storeA
4921  */
4922  __pyx_v_self->A.Dtype = SLU_D;
4923 
4924  /* "superluWrappers.pyx":196
4925  * self.A.Stype = _SLU_NC
4926  * self.A.Dtype = _SLU_D
4927  * self.A.Mtype = _SLU_GE # <<<<<<<<<<<<<<
4928  * self.A.Store = &self.storeA
4929  *
4930  */
4931  __pyx_v_self->A.Mtype = SLU_GE;
4932 
4933  /* "superluWrappers.pyx":197
4934  * self.A.Dtype = _SLU_D
4935  * self.A.Mtype = _SLU_GE
4936  * self.A.Store = &self.storeA # <<<<<<<<<<<<<<
4937  *
4938  * self.AC.Stype = _SLU_NCP
4939  */
4940  __pyx_v_self->A.Store = (&__pyx_v_self->storeA);
4941 
4942  /* "superluWrappers.pyx":199
4943  * self.A.Store = &self.storeA
4944  *
4945  * self.AC.Stype = _SLU_NCP # <<<<<<<<<<<<<<
4946  * self.AC.Dtype = _SLU_D
4947  * self.AC.Mtype = _SLU_GE
4948  */
4949  __pyx_v_self->AC.Stype = SLU_NCP;
4950 
4951  /* "superluWrappers.pyx":200
4952  *
4953  * self.AC.Stype = _SLU_NCP
4954  * self.AC.Dtype = _SLU_D # <<<<<<<<<<<<<<
4955  * self.AC.Mtype = _SLU_GE
4956  * self.AC.Store = NULL
4957  */
4958  __pyx_v_self->AC.Dtype = SLU_D;
4959 
4960  /* "superluWrappers.pyx":201
4961  * self.AC.Stype = _SLU_NCP
4962  * self.AC.Dtype = _SLU_D
4963  * self.AC.Mtype = _SLU_GE # <<<<<<<<<<<<<<
4964  * self.AC.Store = NULL
4965  *
4966  */
4967  __pyx_v_self->AC.Mtype = SLU_GE;
4968 
4969  /* "superluWrappers.pyx":202
4970  * self.AC.Dtype = _SLU_D
4971  * self.AC.Mtype = _SLU_GE
4972  * self.AC.Store = NULL # <<<<<<<<<<<<<<
4973  *
4974  * self.L.Stype = _SLU_NC
4975  */
4976  __pyx_v_self->AC.Store = NULL;
4977 
4978  /* "superluWrappers.pyx":204
4979  * self.AC.Store = NULL
4980  *
4981  * self.L.Stype = _SLU_NC # <<<<<<<<<<<<<<
4982  * self.L.Dtype = _SLU_D
4983  * self.L.Mtype = _SLU_TRLU
4984  */
4985  __pyx_v_self->L.Stype = SLU_NC;
4986 
4987  /* "superluWrappers.pyx":205
4988  *
4989  * self.L.Stype = _SLU_NC
4990  * self.L.Dtype = _SLU_D # <<<<<<<<<<<<<<
4991  * self.L.Mtype = _SLU_TRLU
4992  * self.L.Store = NULL
4993  */
4994  __pyx_v_self->L.Dtype = SLU_D;
4995 
4996  /* "superluWrappers.pyx":206
4997  * self.L.Stype = _SLU_NC
4998  * self.L.Dtype = _SLU_D
4999  * self.L.Mtype = _SLU_TRLU # <<<<<<<<<<<<<<
5000  * self.L.Store = NULL
5001  *
5002  */
5003  __pyx_v_self->L.Mtype = SLU_TRLU;
5004 
5005  /* "superluWrappers.pyx":207
5006  * self.L.Dtype = _SLU_D
5007  * self.L.Mtype = _SLU_TRLU
5008  * self.L.Store = NULL # <<<<<<<<<<<<<<
5009  *
5010  * self.U.Stype = _SLU_NC
5011  */
5012  __pyx_v_self->L.Store = NULL;
5013 
5014  /* "superluWrappers.pyx":209
5015  * self.L.Store = NULL
5016  *
5017  * self.U.Stype = _SLU_NC # <<<<<<<<<<<<<<
5018  * self.U.Dtype = _SLU_D
5019  * self.U.Mtype = _SLU_TRU
5020  */
5021  __pyx_v_self->U.Stype = SLU_NC;
5022 
5023  /* "superluWrappers.pyx":210
5024  *
5025  * self.U.Stype = _SLU_NC
5026  * self.U.Dtype = _SLU_D # <<<<<<<<<<<<<<
5027  * self.U.Mtype = _SLU_TRU
5028  * self.U.Store = NULL
5029  */
5030  __pyx_v_self->U.Dtype = SLU_D;
5031 
5032  /* "superluWrappers.pyx":211
5033  * self.U.Stype = _SLU_NC
5034  * self.U.Dtype = _SLU_D
5035  * self.U.Mtype = _SLU_TRU # <<<<<<<<<<<<<<
5036  * self.U.Store = NULL
5037  *
5038  */
5039  __pyx_v_self->U.Mtype = SLU_TRU;
5040 
5041  /* "superluWrappers.pyx":212
5042  * self.U.Dtype = _SLU_D
5043  * self.U.Mtype = _SLU_TRU
5044  * self.U.Store = NULL # <<<<<<<<<<<<<<
5045  *
5046  * self.X.Stype = _SLU_DN
5047  */
5048  __pyx_v_self->U.Store = NULL;
5049 
5050  /* "superluWrappers.pyx":214
5051  * self.U.Store = NULL
5052  *
5053  * self.X.Stype = _SLU_DN # <<<<<<<<<<<<<<
5054  * self.X.Dtype = _SLU_D
5055  * self.X.Mtype = _SLU_GE
5056  */
5057  __pyx_v_self->X.Stype = SLU_DN;
5058 
5059  /* "superluWrappers.pyx":215
5060  *
5061  * self.X.Stype = _SLU_DN
5062  * self.X.Dtype = _SLU_D # <<<<<<<<<<<<<<
5063  * self.X.Mtype = _SLU_GE
5064  * self.X.Store = &self.storeX
5065  */
5066  __pyx_v_self->X.Dtype = SLU_D;
5067 
5068  /* "superluWrappers.pyx":216
5069  * self.X.Stype = _SLU_DN
5070  * self.X.Dtype = _SLU_D
5071  * self.X.Mtype = _SLU_GE # <<<<<<<<<<<<<<
5072  * self.X.Store = &self.storeX
5073  *
5074  */
5075  __pyx_v_self->X.Mtype = SLU_GE;
5076 
5077  /* "superluWrappers.pyx":217
5078  * self.X.Dtype = _SLU_D
5079  * self.X.Mtype = _SLU_GE
5080  * self.X.Store = &self.storeX # <<<<<<<<<<<<<<
5081  *
5082  * def sparseFactorPrepare(sparse_matrix,
5083  */
5084  __pyx_v_self->X.Store = (&__pyx_v_self->storeX);
5085 
5086  /* "superluWrappers.pyx":193
5087  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
5088  *
5089  * cdef _set_mat_types(self): # <<<<<<<<<<<<<<
5090  * self.A.Stype = _SLU_NC
5091  * self.A.Dtype = _SLU_D
5092  */
5093 
5094  /* function exit code */
5095  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5096  __Pyx_XGIVEREF(__pyx_r);
5097  __Pyx_RefNannyFinishContext();
5098  return __pyx_r;
5099 }
5100 
5101 /* "superluWrappers.pyx":168
5102  * cdef unsigned int use_same_sparsity
5103  *
5104  * cdef public int dim # <<<<<<<<<<<<<<
5105  *
5106  * def __init__(self, dim):
5107  */
5108 
5109 /* Python wrapper */
5110 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(PyObject *__pyx_v_self); /*proto*/
5111 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(PyObject *__pyx_v_self) {
5112  PyObject *__pyx_r = 0;
5113  __Pyx_RefNannyDeclarations
5114  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5115  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self));
5116 
5117  /* function exit code */
5118  __Pyx_RefNannyFinishContext();
5119  return __pyx_r;
5120 }
5121 
5122 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
5123  PyObject *__pyx_r = NULL;
5124  __Pyx_RefNannyDeclarations
5125  PyObject *__pyx_t_1 = NULL;
5126  __Pyx_RefNannySetupContext("__get__", 0);
5127  __Pyx_XDECREF(__pyx_r);
5128  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
5129  __Pyx_GOTREF(__pyx_t_1);
5130  __pyx_r = __pyx_t_1;
5131  __pyx_t_1 = 0;
5132  goto __pyx_L0;
5133 
5134  /* function exit code */
5135  __pyx_L1_error:;
5136  __Pyx_XDECREF(__pyx_t_1);
5137  __Pyx_AddTraceback("superluWrappers.SparseFactor.dim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5138  __pyx_r = NULL;
5139  __pyx_L0:;
5140  __Pyx_XGIVEREF(__pyx_r);
5141  __Pyx_RefNannyFinishContext();
5142  return __pyx_r;
5143 }
5144 
5145 /* Python wrapper */
5146 static int __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
5147 static int __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
5148  int __pyx_r;
5149  __Pyx_RefNannyDeclarations
5150  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
5151  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), ((PyObject *)__pyx_v_value));
5152 
5153  /* function exit code */
5154  __Pyx_RefNannyFinishContext();
5155  return __pyx_r;
5156 }
5157 
5158 static int __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_value) {
5159  int __pyx_r;
5160  __Pyx_RefNannyDeclarations
5161  int __pyx_t_1;
5162  __Pyx_RefNannySetupContext("__set__", 0);
5163  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L1_error)
5164  __pyx_v_self->dim = __pyx_t_1;
5165 
5166  /* function exit code */
5167  __pyx_r = 0;
5168  goto __pyx_L0;
5169  __pyx_L1_error:;
5170  __Pyx_AddTraceback("superluWrappers.SparseFactor.dim.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5171  __pyx_r = -1;
5172  __pyx_L0:;
5173  __Pyx_RefNannyFinishContext();
5174  return __pyx_r;
5175 }
5176 
5177 /* "(tree fragment)":1
5178  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5179  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5180  * def __setstate_cython__(self, __pyx_state):
5181  */
5182 
5183 /* Python wrapper */
5184 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5185 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5186  PyObject *__pyx_r = 0;
5187  __Pyx_RefNannyDeclarations
5188  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5189  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self));
5190 
5191  /* function exit code */
5192  __Pyx_RefNannyFinishContext();
5193  return __pyx_r;
5194 }
5195 
5196 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self) {
5197  PyObject *__pyx_r = NULL;
5198  __Pyx_RefNannyDeclarations
5199  PyObject *__pyx_t_1 = NULL;
5200  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
5201 
5202  /* "(tree fragment)":2
5203  * def __reduce_cython__(self):
5204  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
5205  * def __setstate_cython__(self, __pyx_state):
5206  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5207  */
5208  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
5209  __Pyx_GOTREF(__pyx_t_1);
5210  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5211  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5212  __PYX_ERR(1, 2, __pyx_L1_error)
5213 
5214  /* "(tree fragment)":1
5215  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5216  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5217  * def __setstate_cython__(self, __pyx_state):
5218  */
5219 
5220  /* function exit code */
5221  __pyx_L1_error:;
5222  __Pyx_XDECREF(__pyx_t_1);
5223  __Pyx_AddTraceback("superluWrappers.SparseFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5224  __pyx_r = NULL;
5225  __Pyx_XGIVEREF(__pyx_r);
5226  __Pyx_RefNannyFinishContext();
5227  return __pyx_r;
5228 }
5229 
5230 /* "(tree fragment)":3
5231  * def __reduce_cython__(self):
5232  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5233  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5234  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5235  */
5236 
5237 /* Python wrapper */
5238 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
5239 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5240  PyObject *__pyx_r = 0;
5241  __Pyx_RefNannyDeclarations
5242  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
5243  __pyx_r = __pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5244 
5245  /* function exit code */
5246  __Pyx_RefNannyFinishContext();
5247  return __pyx_r;
5248 }
5249 
5250 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5251  PyObject *__pyx_r = NULL;
5252  __Pyx_RefNannyDeclarations
5253  PyObject *__pyx_t_1 = NULL;
5254  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
5255 
5256  /* "(tree fragment)":4
5257  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5258  * def __setstate_cython__(self, __pyx_state):
5259  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
5260  */
5261  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
5262  __Pyx_GOTREF(__pyx_t_1);
5263  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5264  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5265  __PYX_ERR(1, 4, __pyx_L1_error)
5266 
5267  /* "(tree fragment)":3
5268  * def __reduce_cython__(self):
5269  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5270  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5271  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
5272  */
5273 
5274  /* function exit code */
5275  __pyx_L1_error:;
5276  __Pyx_XDECREF(__pyx_t_1);
5277  __Pyx_AddTraceback("superluWrappers.SparseFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5278  __pyx_r = NULL;
5279  __Pyx_XGIVEREF(__pyx_r);
5280  __Pyx_RefNannyFinishContext();
5281  return __pyx_r;
5282 }
5283 
5284 /* "superluWrappers.pyx":219
5285  * self.X.Store = &self.storeX
5286  *
5287  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
5288  * sparseFactor):
5289  * """ Python wrapper for superlu Sparse Factor Prepare function.
5290  */
5291 
5292 /* Python wrapper */
5293 static PyObject *__pyx_pw_15superluWrappers_1sparseFactorPrepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5294 static char __pyx_doc_15superluWrappers_sparseFactorPrepare[] = " Python wrapper for superlu Sparse Factor Prepare function.\n\n Arguments\n ---------\n sparse_matrix : superluWrappers.SparseMatrix\n sparseFactor: superluWrappers.SparseFactor\n\n ";
5295 static PyMethodDef __pyx_mdef_15superluWrappers_1sparseFactorPrepare = {"sparseFactorPrepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_1sparseFactorPrepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_sparseFactorPrepare};
5296 static PyObject *__pyx_pw_15superluWrappers_1sparseFactorPrepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5297  PyObject *__pyx_v_sparse_matrix = 0;
5298  PyObject *__pyx_v_sparseFactor = 0;
5299  PyObject *__pyx_r = 0;
5300  __Pyx_RefNannyDeclarations
5301  __Pyx_RefNannySetupContext("sparseFactorPrepare (wrapper)", 0);
5302  {
5303  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sparse_matrix,&__pyx_n_s_sparseFactor,0};
5304  PyObject* values[2] = {0,0};
5305  if (unlikely(__pyx_kwds)) {
5306  Py_ssize_t kw_args;
5307  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5308  switch (pos_args) {
5309  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5310  CYTHON_FALLTHROUGH;
5311  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5312  CYTHON_FALLTHROUGH;
5313  case 0: break;
5314  default: goto __pyx_L5_argtuple_error;
5315  }
5316  kw_args = PyDict_Size(__pyx_kwds);
5317  switch (pos_args) {
5318  case 0:
5319  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparse_matrix)) != 0)) kw_args--;
5320  else goto __pyx_L5_argtuple_error;
5321  CYTHON_FALLTHROUGH;
5322  case 1:
5323  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparseFactor)) != 0)) kw_args--;
5324  else {
5325  __Pyx_RaiseArgtupleInvalid("sparseFactorPrepare", 1, 2, 2, 1); __PYX_ERR(0, 219, __pyx_L3_error)
5326  }
5327  }
5328  if (unlikely(kw_args > 0)) {
5329  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparseFactorPrepare") < 0)) __PYX_ERR(0, 219, __pyx_L3_error)
5330  }
5331  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5332  goto __pyx_L5_argtuple_error;
5333  } else {
5334  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5335  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5336  }
5337  __pyx_v_sparse_matrix = values[0];
5338  __pyx_v_sparseFactor = values[1];
5339  }
5340  goto __pyx_L4_argument_unpacking_done;
5341  __pyx_L5_argtuple_error:;
5342  __Pyx_RaiseArgtupleInvalid("sparseFactorPrepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 219, __pyx_L3_error)
5343  __pyx_L3_error:;
5344  __Pyx_AddTraceback("superluWrappers.sparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5345  __Pyx_RefNannyFinishContext();
5346  return NULL;
5347  __pyx_L4_argument_unpacking_done:;
5348  __pyx_r = __pyx_pf_15superluWrappers_sparseFactorPrepare(__pyx_self, __pyx_v_sparse_matrix, __pyx_v_sparseFactor);
5349 
5350  /* function exit code */
5351  __Pyx_RefNannyFinishContext();
5352  return __pyx_r;
5353 }
5354 
5355 static PyObject *__pyx_pf_15superluWrappers_sparseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparse_matrix, PyObject *__pyx_v_sparseFactor) {
5356  PyObject *__pyx_r = NULL;
5357  __Pyx_RefNannyDeclarations
5358  PyObject *__pyx_t_1 = NULL;
5359  __Pyx_RefNannySetupContext("sparseFactorPrepare", 0);
5360 
5361  /* "superluWrappers.pyx":229
5362  *
5363  * """
5364  * superluWrappersSparseFactorPrepare(sparse_matrix._cSparseMatrix, # <<<<<<<<<<<<<<
5365  * sparseFactor)
5366  *
5367  */
5368  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sparse_matrix, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
5369  __Pyx_GOTREF(__pyx_t_1);
5370  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 229, __pyx_L1_error)
5371 
5372  /* "superluWrappers.pyx":230
5373  * """
5374  * superluWrappersSparseFactorPrepare(sparse_matrix._cSparseMatrix,
5375  * sparseFactor) # <<<<<<<<<<<<<<
5376  *
5377  * cdef void superluWrappersSparseFactorPrepare(cSparseMatrix sm,
5378  */
5379  if (!(likely(((__pyx_v_sparseFactor) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sparseFactor, __pyx_ptype_15superluWrappers_SparseFactor))))) __PYX_ERR(0, 230, __pyx_L1_error)
5380 
5381  /* "superluWrappers.pyx":229
5382  *
5383  * """
5384  * superluWrappersSparseFactorPrepare(sparse_matrix._cSparseMatrix, # <<<<<<<<<<<<<<
5385  * sparseFactor)
5386  *
5387  */
5388  __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(((struct __pyx_obj_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_sparseFactor));
5389  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5390 
5391  /* "superluWrappers.pyx":219
5392  * self.X.Store = &self.storeX
5393  *
5394  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
5395  * sparseFactor):
5396  * """ Python wrapper for superlu Sparse Factor Prepare function.
5397  */
5398 
5399  /* function exit code */
5400  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5401  goto __pyx_L0;
5402  __pyx_L1_error:;
5403  __Pyx_XDECREF(__pyx_t_1);
5404  __Pyx_AddTraceback("superluWrappers.sparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5405  __pyx_r = NULL;
5406  __pyx_L0:;
5407  __Pyx_XGIVEREF(__pyx_r);
5408  __Pyx_RefNannyFinishContext();
5409  return __pyx_r;
5410 }
5411 
5412 /* "superluWrappers.pyx":232
5413  * sparseFactor)
5414  *
5415  * cdef void superluWrappersSparseFactorPrepare(cSparseMatrix sm, # <<<<<<<<<<<<<<
5416  * SparseFactor sparseFactor):
5417  *
5418  */
5419 
5420 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_sm, struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_sparseFactor) {
5421  int __pyx_v_permc_spec;
5422  int __pyx_v_n;
5423  int __pyx_v_relax;
5424  int __pyx_v_panel_size;
5425  int __pyx_v_lwork;
5426  int __pyx_v_info;
5427  void *__pyx_v_work;
5428  PyObject *__pyx_v_i = NULL;
5429  __Pyx_RefNannyDeclarations
5430  __pyx_t_5numpy_int32_t __pyx_t_1;
5431  int __pyx_t_2;
5432  int __pyx_t_3;
5433  PyObject *__pyx_t_4 = NULL;
5434  PyObject *__pyx_t_5 = NULL;
5435  Py_ssize_t __pyx_t_6;
5436  PyObject *(*__pyx_t_7)(PyObject *);
5437  Py_ssize_t __pyx_t_8;
5438  Py_ssize_t __pyx_t_9;
5439  __Pyx_RefNannySetupContext("superluWrappersSparseFactorPrepare", 0);
5440 
5441  /* "superluWrappers.pyx":235
5442  * SparseFactor sparseFactor):
5443  *
5444  * cdef int permc_spec = 3 # <<<<<<<<<<<<<<
5445  * cdef int n
5446  * cdef int relax=1
5447  */
5448  __pyx_v_permc_spec = 3;
5449 
5450  /* "superluWrappers.pyx":237
5451  * cdef int permc_spec = 3
5452  * cdef int n
5453  * cdef int relax=1 # <<<<<<<<<<<<<<
5454  * cdef int panel_size = 10
5455  * cdef int lwork = 0
5456  */
5457  __pyx_v_relax = 1;
5458 
5459  /* "superluWrappers.pyx":238
5460  * cdef int n
5461  * cdef int relax=1
5462  * cdef int panel_size = 10 # <<<<<<<<<<<<<<
5463  * cdef int lwork = 0
5464  * cdef int info = 0
5465  */
5466  __pyx_v_panel_size = 10;
5467 
5468  /* "superluWrappers.pyx":239
5469  * cdef int relax=1
5470  * cdef int panel_size = 10
5471  * cdef int lwork = 0 # <<<<<<<<<<<<<<
5472  * cdef int info = 0
5473  * cdef void *work = NULL
5474  */
5475  __pyx_v_lwork = 0;
5476 
5477  /* "superluWrappers.pyx":240
5478  * cdef int panel_size = 10
5479  * cdef int lwork = 0
5480  * cdef int info = 0 # <<<<<<<<<<<<<<
5481  * cdef void *work = NULL
5482  *
5483  */
5484  __pyx_v_info = 0;
5485 
5486  /* "superluWrappers.pyx":241
5487  * cdef int lwork = 0
5488  * cdef int info = 0
5489  * cdef void *work = NULL # <<<<<<<<<<<<<<
5490  *
5491  * sparseFactor.storeA.nnz = sm.A.nnz
5492  */
5493  __pyx_v_work = NULL;
5494 
5495  /* "superluWrappers.pyx":243
5496  * cdef void *work = NULL
5497  *
5498  * sparseFactor.storeA.nnz = sm.A.nnz # <<<<<<<<<<<<<<
5499  * sparseFactor.storeA.nzval = &sm.A.nzval[0]
5500  * sparseFactor.storeA.colptr = &sm.A.rowptr[0]
5501  */
5502  __pyx_t_1 = __pyx_v_sm->A.nnz;
5503  __pyx_v_sparseFactor->storeA.nnz = __pyx_t_1;
5504 
5505  /* "superluWrappers.pyx":244
5506  *
5507  * sparseFactor.storeA.nnz = sm.A.nnz
5508  * sparseFactor.storeA.nzval = &sm.A.nzval[0] # <<<<<<<<<<<<<<
5509  * sparseFactor.storeA.colptr = &sm.A.rowptr[0]
5510  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5511  */
5512  __pyx_v_sparseFactor->storeA.nzval = (&(__pyx_v_sm->A.nzval[0]));
5513 
5514  /* "superluWrappers.pyx":245
5515  * sparseFactor.storeA.nnz = sm.A.nnz
5516  * sparseFactor.storeA.nzval = &sm.A.nzval[0]
5517  * sparseFactor.storeA.colptr = &sm.A.rowptr[0] # <<<<<<<<<<<<<<
5518  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5519  *
5520  */
5521  __pyx_v_sparseFactor->storeA.colptr = (&(__pyx_v_sm->A.rowptr[0]));
5522 
5523  /* "superluWrappers.pyx":246
5524  * sparseFactor.storeA.nzval = &sm.A.nzval[0]
5525  * sparseFactor.storeA.colptr = &sm.A.rowptr[0]
5526  * sparseFactor.storeA.rowind = &sm.A.colind[0] # <<<<<<<<<<<<<<
5527  *
5528  * if sparseFactor.use_same_perm_c == 0:
5529  */
5530  __pyx_v_sparseFactor->storeA.rowind = (&(__pyx_v_sm->A.colind[0]));
5531 
5532  /* "superluWrappers.pyx":248
5533  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5534  *
5535  * if sparseFactor.use_same_perm_c == 0: # <<<<<<<<<<<<<<
5536  * cget_perm_c(permc_spec,
5537  * &sparseFactor.A,
5538  */
5539  __pyx_t_2 = ((__pyx_v_sparseFactor->use_same_perm_c == 0) != 0);
5540  if (__pyx_t_2) {
5541 
5542  /* "superluWrappers.pyx":249
5543  *
5544  * if sparseFactor.use_same_perm_c == 0:
5545  * cget_perm_c(permc_spec, # <<<<<<<<<<<<<<
5546  * &sparseFactor.A,
5547  * sparseFactor.perm_c)
5548  */
5549  get_perm_c(__pyx_v_permc_spec, (&__pyx_v_sparseFactor->A), __pyx_v_sparseFactor->perm_c);
5550 
5551  /* "superluWrappers.pyx":252
5552  * &sparseFactor.A,
5553  * sparseFactor.perm_c)
5554  * sparseFactor.use_same_perm_c = 1 # <<<<<<<<<<<<<<
5555  *
5556  * if sparseFactor.use_same_sparsity == 0:
5557  */
5558  __pyx_v_sparseFactor->use_same_perm_c = 1;
5559 
5560  /* "superluWrappers.pyx":248
5561  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5562  *
5563  * if sparseFactor.use_same_perm_c == 0: # <<<<<<<<<<<<<<
5564  * cget_perm_c(permc_spec,
5565  * &sparseFactor.A,
5566  */
5567  }
5568 
5569  /* "superluWrappers.pyx":254
5570  * sparseFactor.use_same_perm_c = 1
5571  *
5572  * if sparseFactor.use_same_sparsity == 0: # <<<<<<<<<<<<<<
5573  * if sparseFactor.AC.Store != NULL:
5574  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5575  */
5576  __pyx_t_2 = ((__pyx_v_sparseFactor->use_same_sparsity == 0) != 0);
5577  if (__pyx_t_2) {
5578 
5579  /* "superluWrappers.pyx":255
5580  *
5581  * if sparseFactor.use_same_sparsity == 0:
5582  * if sparseFactor.AC.Store != NULL: # <<<<<<<<<<<<<<
5583  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5584  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5585  */
5586  __pyx_t_2 = ((__pyx_v_sparseFactor->AC.Store != NULL) != 0);
5587  if (__pyx_t_2) {
5588 
5589  /* "superluWrappers.pyx":256
5590  * if sparseFactor.use_same_sparsity == 0:
5591  * if sparseFactor.AC.Store != NULL:
5592  * cDestroy_CompCol_Permuted(&sparseFactor.AC) # <<<<<<<<<<<<<<
5593  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5594  * cDestroy_CompCol_Matrix(&sparseFactor.U)
5595  */
5596  Destroy_CompCol_Permuted((&__pyx_v_sparseFactor->AC));
5597 
5598  /* "superluWrappers.pyx":257
5599  * if sparseFactor.AC.Store != NULL:
5600  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5601  * cDestroy_SuperNode_Matrix(&sparseFactor.L) # <<<<<<<<<<<<<<
5602  * cDestroy_CompCol_Matrix(&sparseFactor.U)
5603  * csp_preorder(&sparseFactor.options,
5604  */
5605  Destroy_SuperNode_Matrix((&__pyx_v_sparseFactor->L));
5606 
5607  /* "superluWrappers.pyx":258
5608  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5609  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5610  * cDestroy_CompCol_Matrix(&sparseFactor.U) # <<<<<<<<<<<<<<
5611  * csp_preorder(&sparseFactor.options,
5612  * &sparseFactor.A,
5613  */
5614  Destroy_CompCol_Matrix((&__pyx_v_sparseFactor->U));
5615 
5616  /* "superluWrappers.pyx":255
5617  *
5618  * if sparseFactor.use_same_sparsity == 0:
5619  * if sparseFactor.AC.Store != NULL: # <<<<<<<<<<<<<<
5620  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5621  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5622  */
5623  }
5624 
5625  /* "superluWrappers.pyx":259
5626  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5627  * cDestroy_CompCol_Matrix(&sparseFactor.U)
5628  * csp_preorder(&sparseFactor.options, # <<<<<<<<<<<<<<
5629  * &sparseFactor.A,
5630  * sparseFactor.perm_c,
5631  */
5632  sp_preorder((&__pyx_v_sparseFactor->options), (&__pyx_v_sparseFactor->A), __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->etree, (&__pyx_v_sparseFactor->AC));
5633 
5634  /* "superluWrappers.pyx":264
5635  * sparseFactor.etree,
5636  * &sparseFactor.AC)
5637  * sparseFactor.use_same_sparsity = 1 # <<<<<<<<<<<<<<
5638  * else:
5639  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5640  */
5641  __pyx_v_sparseFactor->use_same_sparsity = 1;
5642 
5643  /* "superluWrappers.pyx":254
5644  * sparseFactor.use_same_perm_c = 1
5645  *
5646  * if sparseFactor.use_same_sparsity == 0: # <<<<<<<<<<<<<<
5647  * if sparseFactor.AC.Store != NULL:
5648  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5649  */
5650  goto __pyx_L4;
5651  }
5652 
5653  /* "superluWrappers.pyx":266
5654  * sparseFactor.use_same_sparsity = 1
5655  * else:
5656  * sparseFactor.options.Fact = _SamePattern_SameRowPerm # <<<<<<<<<<<<<<
5657  * n = sparseFactor.A.ncol
5658  * for i in range(n):
5659  */
5660  /*else*/ {
5661  __pyx_v_sparseFactor->options.Fact = SamePattern_SameRowPerm;
5662 
5663  /* "superluWrappers.pyx":267
5664  * else:
5665  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5666  * n = sparseFactor.A.ncol # <<<<<<<<<<<<<<
5667  * for i in range(n):
5668  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5669  */
5670  __pyx_t_3 = __pyx_v_sparseFactor->A.ncol;
5671  __pyx_v_n = __pyx_t_3;
5672 
5673  /* "superluWrappers.pyx":268
5674  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5675  * n = sparseFactor.A.ncol
5676  * for i in range(n): # <<<<<<<<<<<<<<
5677  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5678  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5679  */
5680  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
5681  __Pyx_GOTREF(__pyx_t_4);
5682  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
5683  __Pyx_GOTREF(__pyx_t_5);
5684  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5685  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
5686  __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
5687  __pyx_t_7 = NULL;
5688  } else {
5689  __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
5690  __Pyx_GOTREF(__pyx_t_4);
5691  __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 268, __pyx_L1_error)
5692  }
5693  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5694  for (;;) {
5695  if (likely(!__pyx_t_7)) {
5696  if (likely(PyList_CheckExact(__pyx_t_4))) {
5697  if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
5698  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5699  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
5700  #else
5701  __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
5702  __Pyx_GOTREF(__pyx_t_5);
5703  #endif
5704  } else {
5705  if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
5706  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5707  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
5708  #else
5709  __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
5710  __Pyx_GOTREF(__pyx_t_5);
5711  #endif
5712  }
5713  } else {
5714  __pyx_t_5 = __pyx_t_7(__pyx_t_4);
5715  if (unlikely(!__pyx_t_5)) {
5716  PyObject* exc_type = PyErr_Occurred();
5717  if (exc_type) {
5718  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5719  else __PYX_ERR(0, 268, __pyx_L1_error)
5720  }
5721  break;
5722  }
5723  __Pyx_GOTREF(__pyx_t_5);
5724  }
5725  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
5726  __pyx_t_5 = 0;
5727 
5728  /* "superluWrappers.pyx":269
5729  * n = sparseFactor.A.ncol
5730  * for i in range(n):
5731  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i] # <<<<<<<<<<<<<<
5732  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5733  * cdgstrf(&sparseFactor.options,
5734  */
5735  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
5736  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
5737  (((struct __pyx_t_15superluWrappers__NCPformat *)__pyx_v_sparseFactor->AC.Store)->colbeg[(__pyx_v_sparseFactor->perm_c[__pyx_t_9])]) = (((struct __pyx_t_15superluWrappers__NCformat *)__pyx_v_sparseFactor->A.Store)->colptr[__pyx_t_8]);
5738 
5739  /* "superluWrappers.pyx":270
5740  * for i in range(n):
5741  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5742  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1] # <<<<<<<<<<<<<<
5743  * cdgstrf(&sparseFactor.options,
5744  * &sparseFactor.AC,
5745  */
5746  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error)
5747  __Pyx_GOTREF(__pyx_t_5);
5748  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
5749  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5750  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
5751  (((struct __pyx_t_15superluWrappers__NCPformat *)__pyx_v_sparseFactor->AC.Store)->colend[(__pyx_v_sparseFactor->perm_c[__pyx_t_9])]) = (((struct __pyx_t_15superluWrappers__NCformat *)__pyx_v_sparseFactor->A.Store)->colptr[__pyx_t_8]);
5752 
5753  /* "superluWrappers.pyx":268
5754  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5755  * n = sparseFactor.A.ncol
5756  * for i in range(n): # <<<<<<<<<<<<<<
5757  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5758  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5759  */
5760  }
5761  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5762  }
5763  __pyx_L4:;
5764 
5765  /* "superluWrappers.pyx":271
5766  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5767  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5768  * cdgstrf(&sparseFactor.options, # <<<<<<<<<<<<<<
5769  * &sparseFactor.AC,
5770  * relax,
5771  */
5772  dgstrf((&__pyx_v_sparseFactor->options), (&__pyx_v_sparseFactor->AC), __pyx_v_relax, __pyx_v_panel_size, __pyx_v_sparseFactor->etree, __pyx_v_work, __pyx_v_lwork, __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->perm_r, (&__pyx_v_sparseFactor->L), (&__pyx_v_sparseFactor->U), (&__pyx_v_sparseFactor->Glu), (&__pyx_v_sparseFactor->stat), (&__pyx_v_info));
5773 
5774  /* "superluWrappers.pyx":232
5775  * sparseFactor)
5776  *
5777  * cdef void superluWrappersSparseFactorPrepare(cSparseMatrix sm, # <<<<<<<<<<<<<<
5778  * SparseFactor sparseFactor):
5779  *
5780  */
5781 
5782  /* function exit code */
5783  goto __pyx_L0;
5784  __pyx_L1_error:;
5785  __Pyx_XDECREF(__pyx_t_4);
5786  __Pyx_XDECREF(__pyx_t_5);
5787  __Pyx_WriteUnraisable("superluWrappers.superluWrappersSparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5788  __pyx_L0:;
5789  __Pyx_XDECREF(__pyx_v_i);
5790  __Pyx_RefNannyFinishContext();
5791 }
5792 
5793 /* "superluWrappers.pyx":286
5794  * &info)
5795  *
5796  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
5797  * x):
5798  * """ Sparse factor solve wrappers
5799  */
5800 
5801 /* Python wrapper */
5802 static PyObject *__pyx_pw_15superluWrappers_3sparseFactorSolve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5803 static char __pyx_doc_15superluWrappers_2sparseFactorSolve[] = " Sparse factor solve wrappers\n\n Arguments\n ---------\n sparseFactor : superluWrappers.SparseFactor\n x (input / output) : np.array\n x serves as the right hand side and then becomes the solution\n ";
5804 static PyMethodDef __pyx_mdef_15superluWrappers_3sparseFactorSolve = {"sparseFactorSolve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15superluWrappers_3sparseFactorSolve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_15superluWrappers_2sparseFactorSolve};
5805 static PyObject *__pyx_pw_15superluWrappers_3sparseFactorSolve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5806  PyObject *__pyx_v_sparseFactor = 0;
5807  PyObject *__pyx_v_x = 0;
5808  PyObject *__pyx_r = 0;
5809  __Pyx_RefNannyDeclarations
5810  __Pyx_RefNannySetupContext("sparseFactorSolve (wrapper)", 0);
5811  {
5812  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sparseFactor,&__pyx_n_s_x,0};
5813  PyObject* values[2] = {0,0};
5814  if (unlikely(__pyx_kwds)) {
5815  Py_ssize_t kw_args;
5816  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5817  switch (pos_args) {
5818  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5819  CYTHON_FALLTHROUGH;
5820  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5821  CYTHON_FALLTHROUGH;
5822  case 0: break;
5823  default: goto __pyx_L5_argtuple_error;
5824  }
5825  kw_args = PyDict_Size(__pyx_kwds);
5826  switch (pos_args) {
5827  case 0:
5828  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparseFactor)) != 0)) kw_args--;
5829  else goto __pyx_L5_argtuple_error;
5830  CYTHON_FALLTHROUGH;
5831  case 1:
5832  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5833  else {
5834  __Pyx_RaiseArgtupleInvalid("sparseFactorSolve", 1, 2, 2, 1); __PYX_ERR(0, 286, __pyx_L3_error)
5835  }
5836  }
5837  if (unlikely(kw_args > 0)) {
5838  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sparseFactorSolve") < 0)) __PYX_ERR(0, 286, __pyx_L3_error)
5839  }
5840  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5841  goto __pyx_L5_argtuple_error;
5842  } else {
5843  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5844  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5845  }
5846  __pyx_v_sparseFactor = values[0];
5847  __pyx_v_x = values[1];
5848  }
5849  goto __pyx_L4_argument_unpacking_done;
5850  __pyx_L5_argtuple_error:;
5851  __Pyx_RaiseArgtupleInvalid("sparseFactorSolve", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 286, __pyx_L3_error)
5852  __pyx_L3_error:;
5853  __Pyx_AddTraceback("superluWrappers.sparseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5854  __Pyx_RefNannyFinishContext();
5855  return NULL;
5856  __pyx_L4_argument_unpacking_done:;
5857  __pyx_r = __pyx_pf_15superluWrappers_2sparseFactorSolve(__pyx_self, __pyx_v_sparseFactor, __pyx_v_x);
5858 
5859  /* function exit code */
5860  __Pyx_RefNannyFinishContext();
5861  return __pyx_r;
5862 }
5863 
5864 static PyObject *__pyx_pf_15superluWrappers_2sparseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparseFactor, PyObject *__pyx_v_x) {
5865  PyObject *__pyx_r = NULL;
5866  __Pyx_RefNannyDeclarations
5867  __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
5868  __Pyx_RefNannySetupContext("sparseFactorSolve", 0);
5869 
5870  /* "superluWrappers.pyx":296
5871  * x serves as the right hand side and then becomes the solution
5872  * """
5873  * superluWrappersSparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
5874  * x)
5875  *
5876  */
5877  if (!(likely(((__pyx_v_sparseFactor) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_sparseFactor, __pyx_ptype_15superluWrappers_SparseFactor))))) __PYX_ERR(0, 296, __pyx_L1_error)
5878 
5879  /* "superluWrappers.pyx":297
5880  * """
5881  * superluWrappersSparseFactorSolve(sparseFactor,
5882  * x) # <<<<<<<<<<<<<<
5883  *
5884  *
5885  */
5886  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_x, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 297, __pyx_L1_error)
5887 
5888  /* "superluWrappers.pyx":296
5889  * x serves as the right hand side and then becomes the solution
5890  * """
5891  * superluWrappersSparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
5892  * x)
5893  *
5894  */
5895  __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(((struct __pyx_obj_15superluWrappers_SparseFactor *)__pyx_v_sparseFactor), __pyx_t_1);
5896  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
5897  __pyx_t_1.memview = NULL;
5898  __pyx_t_1.data = NULL;
5899 
5900  /* "superluWrappers.pyx":286
5901  * &info)
5902  *
5903  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
5904  * x):
5905  * """ Sparse factor solve wrappers
5906  */
5907 
5908  /* function exit code */
5909  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5910  goto __pyx_L0;
5911  __pyx_L1_error:;
5912  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
5913  __Pyx_AddTraceback("superluWrappers.sparseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5914  __pyx_r = NULL;
5915  __pyx_L0:;
5916  __Pyx_XGIVEREF(__pyx_r);
5917  __Pyx_RefNannyFinishContext();
5918  return __pyx_r;
5919 }
5920 
5921 /* "superluWrappers.pyx":300
5922  *
5923  *
5924  * cdef void superluWrappersSparseFactorSolve(SparseFactor sparseFactor, # <<<<<<<<<<<<<<
5925  * np.float64_t [:] x):
5926  * cdef _trans_t trans = _TRANS
5927  */
5928 
5929 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_sparseFactor, __Pyx_memviewslice __pyx_v_x) {
5930  trans_t __pyx_v_trans;
5931  int __pyx_v_info;
5932  __Pyx_RefNannyDeclarations
5933  Py_ssize_t __pyx_t_1;
5934  __Pyx_RefNannySetupContext("superluWrappersSparseFactorSolve", 0);
5935 
5936  /* "superluWrappers.pyx":302
5937  * cdef void superluWrappersSparseFactorSolve(SparseFactor sparseFactor,
5938  * np.float64_t [:] x):
5939  * cdef _trans_t trans = _TRANS # <<<<<<<<<<<<<<
5940  * cdef int info = 0
5941  *
5942  */
5943  __pyx_v_trans = TRANS;
5944 
5945  /* "superluWrappers.pyx":303
5946  * np.float64_t [:] x):
5947  * cdef _trans_t trans = _TRANS
5948  * cdef int info = 0 # <<<<<<<<<<<<<<
5949  *
5950  * sparseFactor.storeX.nzval = &x[0]
5951  */
5952  __pyx_v_info = 0;
5953 
5954  /* "superluWrappers.pyx":305
5955  * cdef int info = 0
5956  *
5957  * sparseFactor.storeX.nzval = &x[0] # <<<<<<<<<<<<<<
5958  *
5959  * cdgstrs(trans,
5960  */
5961  __pyx_t_1 = 0;
5962  __pyx_v_sparseFactor->storeX.nzval = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_1 * __pyx_v_x.strides[0]) ))));
5963 
5964  /* "superluWrappers.pyx":307
5965  * sparseFactor.storeX.nzval = &x[0]
5966  *
5967  * cdgstrs(trans, # <<<<<<<<<<<<<<
5968  * &sparseFactor.L,
5969  * &sparseFactor.U,
5970  */
5971  dgstrs(__pyx_v_trans, (&__pyx_v_sparseFactor->L), (&__pyx_v_sparseFactor->U), __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->perm_r, (&__pyx_v_sparseFactor->X), (&__pyx_v_sparseFactor->stat), (&__pyx_v_info));
5972 
5973  /* "superluWrappers.pyx":300
5974  *
5975  *
5976  * cdef void superluWrappersSparseFactorSolve(SparseFactor sparseFactor, # <<<<<<<<<<<<<<
5977  * np.float64_t [:] x):
5978  * cdef _trans_t trans = _TRANS
5979  */
5980 
5981  /* function exit code */
5982  __Pyx_RefNannyFinishContext();
5983 }
5984 
5985 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
5986  * # experimental exception made for __getbuffer__ and __releasebuffer__
5987  * # -- the details of this may change.
5988  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
5989  * # This implementation of getbuffer is geared towards Cython
5990  * # requirements, and does not yet fulfill the PEP.
5991  */
5992 
5993 /* Python wrapper */
5994 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
5995 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5996  int __pyx_r;
5997  __Pyx_RefNannyDeclarations
5998  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
5999  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
6000 
6001  /* function exit code */
6002  __Pyx_RefNannyFinishContext();
6003  return __pyx_r;
6004 }
6005 
6006 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6007  int __pyx_v_i;
6008  int __pyx_v_ndim;
6009  int __pyx_v_endian_detector;
6010  int __pyx_v_little_endian;
6011  int __pyx_v_t;
6012  char *__pyx_v_f;
6013  PyArray_Descr *__pyx_v_descr = 0;
6014  int __pyx_v_offset;
6015  int __pyx_r;
6016  __Pyx_RefNannyDeclarations
6017  int __pyx_t_1;
6018  int __pyx_t_2;
6019  PyObject *__pyx_t_3 = NULL;
6020  int __pyx_t_4;
6021  int __pyx_t_5;
6022  int __pyx_t_6;
6023  PyArray_Descr *__pyx_t_7;
6024  PyObject *__pyx_t_8 = NULL;
6025  char *__pyx_t_9;
6026  if (__pyx_v_info == NULL) {
6027  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
6028  return -1;
6029  }
6030  __Pyx_RefNannySetupContext("__getbuffer__", 0);
6031  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
6032  __Pyx_GIVEREF(__pyx_v_info->obj);
6033 
6034  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
6035  *
6036  * cdef int i, ndim
6037  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
6038  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6039  *
6040  */
6041  __pyx_v_endian_detector = 1;
6042 
6043  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
6044  * cdef int i, ndim
6045  * cdef int endian_detector = 1
6046  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
6047  *
6048  * ndim = PyArray_NDIM(self)
6049  */
6050  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
6051 
6052  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
6053  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6054  *
6055  * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
6056  *
6057  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6058  */
6059  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
6060 
6061  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
6062  * ndim = PyArray_NDIM(self)
6063  *
6064  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6065  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6066  * raise ValueError(u"ndarray is not C contiguous")
6067  */
6068  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
6069  if (__pyx_t_2) {
6070  } else {
6071  __pyx_t_1 = __pyx_t_2;
6072  goto __pyx_L4_bool_binop_done;
6073  }
6074 
6075  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
6076  *
6077  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6078  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
6079  * raise ValueError(u"ndarray is not C contiguous")
6080  *
6081  */
6082  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
6083  __pyx_t_1 = __pyx_t_2;
6084  __pyx_L4_bool_binop_done:;
6085 
6086  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
6087  * ndim = PyArray_NDIM(self)
6088  *
6089  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6090  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6091  * raise ValueError(u"ndarray is not C contiguous")
6092  */
6093  if (unlikely(__pyx_t_1)) {
6094 
6095  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
6096  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
6097  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6098  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
6099  *
6100  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6101  */
6102  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 272, __pyx_L1_error)
6103  __Pyx_GOTREF(__pyx_t_3);
6104  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6105  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6106  __PYX_ERR(2, 272, __pyx_L1_error)
6107 
6108  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
6109  * ndim = PyArray_NDIM(self)
6110  *
6111  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
6112  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
6113  * raise ValueError(u"ndarray is not C contiguous")
6114  */
6115  }
6116 
6117  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
6118  * raise ValueError(u"ndarray is not C contiguous")
6119  *
6120  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
6121  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
6122  * raise ValueError(u"ndarray is not Fortran contiguous")
6123  */
6124  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
6125  if (__pyx_t_2) {
6126  } else {
6127  __pyx_t_1 = __pyx_t_2;
6128  goto __pyx_L7_bool_binop_done;
6129  }
6130 
6131  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":275
6132  *
6133  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6134  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
6135  * raise ValueError(u"ndarray is not Fortran contiguous")
6136  *
6137  */
6138  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
6139  __pyx_t_1 = __pyx_t_2;
6140  __pyx_L7_bool_binop_done:;
6141 
6142  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
6143  * raise ValueError(u"ndarray is not C contiguous")
6144  *
6145  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
6146  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
6147  * raise ValueError(u"ndarray is not Fortran contiguous")
6148  */
6149  if (unlikely(__pyx_t_1)) {
6150 
6151  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
6152  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
6153  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
6154  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
6155  *
6156  * info.buf = PyArray_DATA(self)
6157  */
6158  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 276, __pyx_L1_error)
6159  __Pyx_GOTREF(__pyx_t_3);
6160  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6161  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6162  __PYX_ERR(2, 276, __pyx_L1_error)
6163 
6164  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
6165  * raise ValueError(u"ndarray is not C contiguous")
6166  *
6167  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
6168  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
6169  * raise ValueError(u"ndarray is not Fortran contiguous")
6170  */
6171  }
6172 
6173  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
6174  * raise ValueError(u"ndarray is not Fortran contiguous")
6175  *
6176  * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
6177  * info.ndim = ndim
6178  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6179  */
6180  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
6181 
6182  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":279
6183  *
6184  * info.buf = PyArray_DATA(self)
6185  * info.ndim = ndim # <<<<<<<<<<<<<<
6186  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6187  * # Allocate new buffer for strides and shape info.
6188  */
6189  __pyx_v_info->ndim = __pyx_v_ndim;
6190 
6191  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
6192  * info.buf = PyArray_DATA(self)
6193  * info.ndim = ndim
6194  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6195  * # Allocate new buffer for strides and shape info.
6196  * # This is allocated as one block, strides first.
6197  */
6198  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
6199  if (__pyx_t_1) {
6200 
6201  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
6202  * # Allocate new buffer for strides and shape info.
6203  * # This is allocated as one block, strides first.
6204  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
6205  * info.shape = info.strides + ndim
6206  * for i in range(ndim):
6207  */
6208  __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
6209 
6210  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":284
6211  * # This is allocated as one block, strides first.
6212  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
6213  * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
6214  * for i in range(ndim):
6215  * info.strides[i] = PyArray_STRIDES(self)[i]
6216  */
6217  __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
6218 
6219  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":285
6220  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
6221  * info.shape = info.strides + ndim
6222  * for i in range(ndim): # <<<<<<<<<<<<<<
6223  * info.strides[i] = PyArray_STRIDES(self)[i]
6224  * info.shape[i] = PyArray_DIMS(self)[i]
6225  */
6226  __pyx_t_4 = __pyx_v_ndim;
6227  __pyx_t_5 = __pyx_t_4;
6228  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
6229  __pyx_v_i = __pyx_t_6;
6230 
6231  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
6232  * info.shape = info.strides + ndim
6233  * for i in range(ndim):
6234  * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
6235  * info.shape[i] = PyArray_DIMS(self)[i]
6236  * else:
6237  */
6238  (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
6239 
6240  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":287
6241  * for i in range(ndim):
6242  * info.strides[i] = PyArray_STRIDES(self)[i]
6243  * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
6244  * else:
6245  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
6246  */
6247  (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
6248  }
6249 
6250  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
6251  * info.buf = PyArray_DATA(self)
6252  * info.ndim = ndim
6253  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6254  * # Allocate new buffer for strides and shape info.
6255  * # This is allocated as one block, strides first.
6256  */
6257  goto __pyx_L9;
6258  }
6259 
6260  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
6261  * info.shape[i] = PyArray_DIMS(self)[i]
6262  * else:
6263  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
6264  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
6265  * info.suboffsets = NULL
6266  */
6267  /*else*/ {
6268  __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
6269 
6270  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
6271  * else:
6272  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
6273  * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
6274  * info.suboffsets = NULL
6275  * info.itemsize = PyArray_ITEMSIZE(self)
6276  */
6277  __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
6278  }
6279  __pyx_L9:;
6280 
6281  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
6282  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
6283  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
6284  * info.suboffsets = NULL # <<<<<<<<<<<<<<
6285  * info.itemsize = PyArray_ITEMSIZE(self)
6286  * info.readonly = not PyArray_ISWRITEABLE(self)
6287  */
6288  __pyx_v_info->suboffsets = NULL;
6289 
6290  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
6291  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
6292  * info.suboffsets = NULL
6293  * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
6294  * info.readonly = not PyArray_ISWRITEABLE(self)
6295  *
6296  */
6297  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
6298 
6299  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":293
6300  * info.suboffsets = NULL
6301  * info.itemsize = PyArray_ITEMSIZE(self)
6302  * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
6303  *
6304  * cdef int t
6305  */
6306  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
6307 
6308  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":296
6309  *
6310  * cdef int t
6311  * cdef char* f = NULL # <<<<<<<<<<<<<<
6312  * cdef dtype descr = <dtype>PyArray_DESCR(self)
6313  * cdef int offset
6314  */
6315  __pyx_v_f = NULL;
6316 
6317  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":297
6318  * cdef int t
6319  * cdef char* f = NULL
6320  * cdef dtype descr = <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
6321  * cdef int offset
6322  *
6323  */
6324  __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
6325  __pyx_t_3 = ((PyObject *)__pyx_t_7);
6326  __Pyx_INCREF(__pyx_t_3);
6327  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
6328  __pyx_t_3 = 0;
6329 
6330  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":300
6331  * cdef int offset
6332  *
6333  * info.obj = self # <<<<<<<<<<<<<<
6334  *
6335  * if not PyDataType_HASFIELDS(descr):
6336  */
6337  __Pyx_INCREF(((PyObject *)__pyx_v_self));
6338  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
6339  __Pyx_GOTREF(__pyx_v_info->obj);
6340  __Pyx_DECREF(__pyx_v_info->obj);
6341  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
6342 
6343  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
6344  * info.obj = self
6345  *
6346  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
6347  * t = descr.type_num
6348  * if ((descr.byteorder == c'>' and little_endian) or
6349  */
6350  __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
6351  if (__pyx_t_1) {
6352 
6353  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":303
6354  *
6355  * if not PyDataType_HASFIELDS(descr):
6356  * t = descr.type_num # <<<<<<<<<<<<<<
6357  * if ((descr.byteorder == c'>' and little_endian) or
6358  * (descr.byteorder == c'<' and not little_endian)):
6359  */
6360  __pyx_t_4 = __pyx_v_descr->type_num;
6361  __pyx_v_t = __pyx_t_4;
6362 
6363  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
6364  * if not PyDataType_HASFIELDS(descr):
6365  * t = descr.type_num
6366  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6367  * (descr.byteorder == c'<' and not little_endian)):
6368  * raise ValueError(u"Non-native byte order not supported")
6369  */
6370  __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
6371  if (!__pyx_t_2) {
6372  goto __pyx_L15_next_or;
6373  } else {
6374  }
6375  __pyx_t_2 = (__pyx_v_little_endian != 0);
6376  if (!__pyx_t_2) {
6377  } else {
6378  __pyx_t_1 = __pyx_t_2;
6379  goto __pyx_L14_bool_binop_done;
6380  }
6381  __pyx_L15_next_or:;
6382 
6383  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":305
6384  * t = descr.type_num
6385  * if ((descr.byteorder == c'>' and little_endian) or
6386  * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
6387  * raise ValueError(u"Non-native byte order not supported")
6388  * if t == NPY_BYTE: f = "b"
6389  */
6390  __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
6391  if (__pyx_t_2) {
6392  } else {
6393  __pyx_t_1 = __pyx_t_2;
6394  goto __pyx_L14_bool_binop_done;
6395  }
6396  __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
6397  __pyx_t_1 = __pyx_t_2;
6398  __pyx_L14_bool_binop_done:;
6399 
6400  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
6401  * if not PyDataType_HASFIELDS(descr):
6402  * t = descr.type_num
6403  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6404  * (descr.byteorder == c'<' and not little_endian)):
6405  * raise ValueError(u"Non-native byte order not supported")
6406  */
6407  if (unlikely(__pyx_t_1)) {
6408 
6409  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
6410  * if ((descr.byteorder == c'>' and little_endian) or
6411  * (descr.byteorder == c'<' and not little_endian)):
6412  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
6413  * if t == NPY_BYTE: f = "b"
6414  * elif t == NPY_UBYTE: f = "B"
6415  */
6416  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 306, __pyx_L1_error)
6417  __Pyx_GOTREF(__pyx_t_3);
6418  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6419  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6420  __PYX_ERR(2, 306, __pyx_L1_error)
6421 
6422  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
6423  * if not PyDataType_HASFIELDS(descr):
6424  * t = descr.type_num
6425  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6426  * (descr.byteorder == c'<' and not little_endian)):
6427  * raise ValueError(u"Non-native byte order not supported")
6428  */
6429  }
6430 
6431  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":307
6432  * (descr.byteorder == c'<' and not little_endian)):
6433  * raise ValueError(u"Non-native byte order not supported")
6434  * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
6435  * elif t == NPY_UBYTE: f = "B"
6436  * elif t == NPY_SHORT: f = "h"
6437  */
6438  switch (__pyx_v_t) {
6439  case NPY_BYTE:
6440  __pyx_v_f = ((char *)"b");
6441  break;
6442  case NPY_UBYTE:
6443 
6444  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":308
6445  * raise ValueError(u"Non-native byte order not supported")
6446  * if t == NPY_BYTE: f = "b"
6447  * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
6448  * elif t == NPY_SHORT: f = "h"
6449  * elif t == NPY_USHORT: f = "H"
6450  */
6451  __pyx_v_f = ((char *)"B");
6452  break;
6453  case NPY_SHORT:
6454 
6455  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":309
6456  * if t == NPY_BYTE: f = "b"
6457  * elif t == NPY_UBYTE: f = "B"
6458  * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
6459  * elif t == NPY_USHORT: f = "H"
6460  * elif t == NPY_INT: f = "i"
6461  */
6462  __pyx_v_f = ((char *)"h");
6463  break;
6464  case NPY_USHORT:
6465 
6466  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":310
6467  * elif t == NPY_UBYTE: f = "B"
6468  * elif t == NPY_SHORT: f = "h"
6469  * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
6470  * elif t == NPY_INT: f = "i"
6471  * elif t == NPY_UINT: f = "I"
6472  */
6473  __pyx_v_f = ((char *)"H");
6474  break;
6475  case NPY_INT:
6476 
6477  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":311
6478  * elif t == NPY_SHORT: f = "h"
6479  * elif t == NPY_USHORT: f = "H"
6480  * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
6481  * elif t == NPY_UINT: f = "I"
6482  * elif t == NPY_LONG: f = "l"
6483  */
6484  __pyx_v_f = ((char *)"i");
6485  break;
6486  case NPY_UINT:
6487 
6488  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":312
6489  * elif t == NPY_USHORT: f = "H"
6490  * elif t == NPY_INT: f = "i"
6491  * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
6492  * elif t == NPY_LONG: f = "l"
6493  * elif t == NPY_ULONG: f = "L"
6494  */
6495  __pyx_v_f = ((char *)"I");
6496  break;
6497  case NPY_LONG:
6498 
6499  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":313
6500  * elif t == NPY_INT: f = "i"
6501  * elif t == NPY_UINT: f = "I"
6502  * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
6503  * elif t == NPY_ULONG: f = "L"
6504  * elif t == NPY_LONGLONG: f = "q"
6505  */
6506  __pyx_v_f = ((char *)"l");
6507  break;
6508  case NPY_ULONG:
6509 
6510  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":314
6511  * elif t == NPY_UINT: f = "I"
6512  * elif t == NPY_LONG: f = "l"
6513  * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
6514  * elif t == NPY_LONGLONG: f = "q"
6515  * elif t == NPY_ULONGLONG: f = "Q"
6516  */
6517  __pyx_v_f = ((char *)"L");
6518  break;
6519  case NPY_LONGLONG:
6520 
6521  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":315
6522  * elif t == NPY_LONG: f = "l"
6523  * elif t == NPY_ULONG: f = "L"
6524  * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
6525  * elif t == NPY_ULONGLONG: f = "Q"
6526  * elif t == NPY_FLOAT: f = "f"
6527  */
6528  __pyx_v_f = ((char *)"q");
6529  break;
6530  case NPY_ULONGLONG:
6531 
6532  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":316
6533  * elif t == NPY_ULONG: f = "L"
6534  * elif t == NPY_LONGLONG: f = "q"
6535  * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
6536  * elif t == NPY_FLOAT: f = "f"
6537  * elif t == NPY_DOUBLE: f = "d"
6538  */
6539  __pyx_v_f = ((char *)"Q");
6540  break;
6541  case NPY_FLOAT:
6542 
6543  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":317
6544  * elif t == NPY_LONGLONG: f = "q"
6545  * elif t == NPY_ULONGLONG: f = "Q"
6546  * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
6547  * elif t == NPY_DOUBLE: f = "d"
6548  * elif t == NPY_LONGDOUBLE: f = "g"
6549  */
6550  __pyx_v_f = ((char *)"f");
6551  break;
6552  case NPY_DOUBLE:
6553 
6554  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":318
6555  * elif t == NPY_ULONGLONG: f = "Q"
6556  * elif t == NPY_FLOAT: f = "f"
6557  * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
6558  * elif t == NPY_LONGDOUBLE: f = "g"
6559  * elif t == NPY_CFLOAT: f = "Zf"
6560  */
6561  __pyx_v_f = ((char *)"d");
6562  break;
6563  case NPY_LONGDOUBLE:
6564 
6565  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":319
6566  * elif t == NPY_FLOAT: f = "f"
6567  * elif t == NPY_DOUBLE: f = "d"
6568  * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
6569  * elif t == NPY_CFLOAT: f = "Zf"
6570  * elif t == NPY_CDOUBLE: f = "Zd"
6571  */
6572  __pyx_v_f = ((char *)"g");
6573  break;
6574  case NPY_CFLOAT:
6575 
6576  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":320
6577  * elif t == NPY_DOUBLE: f = "d"
6578  * elif t == NPY_LONGDOUBLE: f = "g"
6579  * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
6580  * elif t == NPY_CDOUBLE: f = "Zd"
6581  * elif t == NPY_CLONGDOUBLE: f = "Zg"
6582  */
6583  __pyx_v_f = ((char *)"Zf");
6584  break;
6585  case NPY_CDOUBLE:
6586 
6587  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":321
6588  * elif t == NPY_LONGDOUBLE: f = "g"
6589  * elif t == NPY_CFLOAT: f = "Zf"
6590  * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
6591  * elif t == NPY_CLONGDOUBLE: f = "Zg"
6592  * elif t == NPY_OBJECT: f = "O"
6593  */
6594  __pyx_v_f = ((char *)"Zd");
6595  break;
6596  case NPY_CLONGDOUBLE:
6597 
6598  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":322
6599  * elif t == NPY_CFLOAT: f = "Zf"
6600  * elif t == NPY_CDOUBLE: f = "Zd"
6601  * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
6602  * elif t == NPY_OBJECT: f = "O"
6603  * else:
6604  */
6605  __pyx_v_f = ((char *)"Zg");
6606  break;
6607  case NPY_OBJECT:
6608 
6609  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":323
6610  * elif t == NPY_CDOUBLE: f = "Zd"
6611  * elif t == NPY_CLONGDOUBLE: f = "Zg"
6612  * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
6613  * else:
6614  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
6615  */
6616  __pyx_v_f = ((char *)"O");
6617  break;
6618  default:
6619 
6620  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":325
6621  * elif t == NPY_OBJECT: f = "O"
6622  * else:
6623  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
6624  * info.format = f
6625  * return
6626  */
6627  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
6628  __Pyx_GOTREF(__pyx_t_3);
6629  __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 325, __pyx_L1_error)
6630  __Pyx_GOTREF(__pyx_t_8);
6631  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6632  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
6633  __Pyx_GOTREF(__pyx_t_3);
6634  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6635  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6636  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6637  __PYX_ERR(2, 325, __pyx_L1_error)
6638  break;
6639  }
6640 
6641  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":326
6642  * else:
6643  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
6644  * info.format = f # <<<<<<<<<<<<<<
6645  * return
6646  * else:
6647  */
6648  __pyx_v_info->format = __pyx_v_f;
6649 
6650  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":327
6651  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
6652  * info.format = f
6653  * return # <<<<<<<<<<<<<<
6654  * else:
6655  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
6656  */
6657  __pyx_r = 0;
6658  goto __pyx_L0;
6659 
6660  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
6661  * info.obj = self
6662  *
6663  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
6664  * t = descr.type_num
6665  * if ((descr.byteorder == c'>' and little_endian) or
6666  */
6667  }
6668 
6669  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":329
6670  * return
6671  * else:
6672  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
6673  * info.format[0] = c'^' # Native data types, manual alignment
6674  * offset = 0
6675  */
6676  /*else*/ {
6677  __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
6678 
6679  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":330
6680  * else:
6681  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
6682  * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
6683  * offset = 0
6684  * f = _util_dtypestring(descr, info.format + 1,
6685  */
6686  (__pyx_v_info->format[0]) = '^';
6687 
6688  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":331
6689  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
6690  * info.format[0] = c'^' # Native data types, manual alignment
6691  * offset = 0 # <<<<<<<<<<<<<<
6692  * f = _util_dtypestring(descr, info.format + 1,
6693  * info.format + _buffer_format_string_len,
6694  */
6695  __pyx_v_offset = 0;
6696 
6697  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":332
6698  * info.format[0] = c'^' # Native data types, manual alignment
6699  * offset = 0
6700  * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
6701  * info.format + _buffer_format_string_len,
6702  * &offset)
6703  */
6704  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(2, 332, __pyx_L1_error)
6705  __pyx_v_f = __pyx_t_9;
6706 
6707  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":335
6708  * info.format + _buffer_format_string_len,
6709  * &offset)
6710  * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
6711  *
6712  * def __releasebuffer__(ndarray self, Py_buffer* info):
6713  */
6714  (__pyx_v_f[0]) = '\x00';
6715  }
6716 
6717  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
6718  * # experimental exception made for __getbuffer__ and __releasebuffer__
6719  * # -- the details of this may change.
6720  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
6721  * # This implementation of getbuffer is geared towards Cython
6722  * # requirements, and does not yet fulfill the PEP.
6723  */
6724 
6725  /* function exit code */
6726  __pyx_r = 0;
6727  goto __pyx_L0;
6728  __pyx_L1_error:;
6729  __Pyx_XDECREF(__pyx_t_3);
6730  __Pyx_XDECREF(__pyx_t_8);
6731  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6732  __pyx_r = -1;
6733  if (__pyx_v_info->obj != NULL) {
6734  __Pyx_GOTREF(__pyx_v_info->obj);
6735  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6736  }
6737  goto __pyx_L2;
6738  __pyx_L0:;
6739  if (__pyx_v_info->obj == Py_None) {
6740  __Pyx_GOTREF(__pyx_v_info->obj);
6741  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6742  }
6743  __pyx_L2:;
6744  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
6745  __Pyx_RefNannyFinishContext();
6746  return __pyx_r;
6747 }
6748 
6749 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
6750  * f[0] = c'\0' # Terminate format string
6751  *
6752  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
6753  * if PyArray_HASFIELDS(self):
6754  * PyObject_Free(info.format)
6755  */
6756 
6757 /* Python wrapper */
6758 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
6759 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
6760  __Pyx_RefNannyDeclarations
6761  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
6762  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
6763 
6764  /* function exit code */
6765  __Pyx_RefNannyFinishContext();
6766 }
6767 
6768 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
6769  __Pyx_RefNannyDeclarations
6770  int __pyx_t_1;
6771  __Pyx_RefNannySetupContext("__releasebuffer__", 0);
6772 
6773  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
6774  *
6775  * def __releasebuffer__(ndarray self, Py_buffer* info):
6776  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
6777  * PyObject_Free(info.format)
6778  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6779  */
6780  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
6781  if (__pyx_t_1) {
6782 
6783  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":339
6784  * def __releasebuffer__(ndarray self, Py_buffer* info):
6785  * if PyArray_HASFIELDS(self):
6786  * PyObject_Free(info.format) # <<<<<<<<<<<<<<
6787  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6788  * PyObject_Free(info.strides)
6789  */
6790  PyObject_Free(__pyx_v_info->format);
6791 
6792  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
6793  *
6794  * def __releasebuffer__(ndarray self, Py_buffer* info):
6795  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
6796  * PyObject_Free(info.format)
6797  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6798  */
6799  }
6800 
6801  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
6802  * if PyArray_HASFIELDS(self):
6803  * PyObject_Free(info.format)
6804  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6805  * PyObject_Free(info.strides)
6806  * # info.shape was stored after info.strides in the same block
6807  */
6808  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
6809  if (__pyx_t_1) {
6810 
6811  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":341
6812  * PyObject_Free(info.format)
6813  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6814  * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
6815  * # info.shape was stored after info.strides in the same block
6816  *
6817  */
6818  PyObject_Free(__pyx_v_info->strides);
6819 
6820  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
6821  * if PyArray_HASFIELDS(self):
6822  * PyObject_Free(info.format)
6823  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6824  * PyObject_Free(info.strides)
6825  * # info.shape was stored after info.strides in the same block
6826  */
6827  }
6828 
6829  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
6830  * f[0] = c'\0' # Terminate format string
6831  *
6832  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
6833  * if PyArray_HASFIELDS(self):
6834  * PyObject_Free(info.format)
6835  */
6836 
6837  /* function exit code */
6838  __Pyx_RefNannyFinishContext();
6839 }
6840 
6841 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
6842  * ctypedef npy_cdouble complex_t
6843  *
6844  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6845  * return PyArray_MultiIterNew(1, <void*>a)
6846  *
6847  */
6848 
6849 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
6850  PyObject *__pyx_r = NULL;
6851  __Pyx_RefNannyDeclarations
6852  PyObject *__pyx_t_1 = NULL;
6853  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
6854 
6855  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
6856  *
6857  * cdef inline object PyArray_MultiIterNew1(a):
6858  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
6859  *
6860  * cdef inline object PyArray_MultiIterNew2(a, b):
6861  */
6862  __Pyx_XDECREF(__pyx_r);
6863  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 822, __pyx_L1_error)
6864  __Pyx_GOTREF(__pyx_t_1);
6865  __pyx_r = __pyx_t_1;
6866  __pyx_t_1 = 0;
6867  goto __pyx_L0;
6868 
6869  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
6870  * ctypedef npy_cdouble complex_t
6871  *
6872  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6873  * return PyArray_MultiIterNew(1, <void*>a)
6874  *
6875  */
6876 
6877  /* function exit code */
6878  __pyx_L1_error:;
6879  __Pyx_XDECREF(__pyx_t_1);
6880  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6881  __pyx_r = 0;
6882  __pyx_L0:;
6883  __Pyx_XGIVEREF(__pyx_r);
6884  __Pyx_RefNannyFinishContext();
6885  return __pyx_r;
6886 }
6887 
6888 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
6889  * return PyArray_MultiIterNew(1, <void*>a)
6890  *
6891  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6892  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6893  *
6894  */
6895 
6896 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
6897  PyObject *__pyx_r = NULL;
6898  __Pyx_RefNannyDeclarations
6899  PyObject *__pyx_t_1 = NULL;
6900  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
6901 
6902  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":825
6903  *
6904  * cdef inline object PyArray_MultiIterNew2(a, b):
6905  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
6906  *
6907  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6908  */
6909  __Pyx_XDECREF(__pyx_r);
6910  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 825, __pyx_L1_error)
6911  __Pyx_GOTREF(__pyx_t_1);
6912  __pyx_r = __pyx_t_1;
6913  __pyx_t_1 = 0;
6914  goto __pyx_L0;
6915 
6916  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
6917  * return PyArray_MultiIterNew(1, <void*>a)
6918  *
6919  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6920  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6921  *
6922  */
6923 
6924  /* function exit code */
6925  __pyx_L1_error:;
6926  __Pyx_XDECREF(__pyx_t_1);
6927  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6928  __pyx_r = 0;
6929  __pyx_L0:;
6930  __Pyx_XGIVEREF(__pyx_r);
6931  __Pyx_RefNannyFinishContext();
6932  return __pyx_r;
6933 }
6934 
6935 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
6936  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6937  *
6938  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6939  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6940  *
6941  */
6942 
6943 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
6944  PyObject *__pyx_r = NULL;
6945  __Pyx_RefNannyDeclarations
6946  PyObject *__pyx_t_1 = NULL;
6947  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
6948 
6949  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
6950  *
6951  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6952  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
6953  *
6954  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6955  */
6956  __Pyx_XDECREF(__pyx_r);
6957  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 828, __pyx_L1_error)
6958  __Pyx_GOTREF(__pyx_t_1);
6959  __pyx_r = __pyx_t_1;
6960  __pyx_t_1 = 0;
6961  goto __pyx_L0;
6962 
6963  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
6964  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6965  *
6966  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6967  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6968  *
6969  */
6970 
6971  /* function exit code */
6972  __pyx_L1_error:;
6973  __Pyx_XDECREF(__pyx_t_1);
6974  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6975  __pyx_r = 0;
6976  __pyx_L0:;
6977  __Pyx_XGIVEREF(__pyx_r);
6978  __Pyx_RefNannyFinishContext();
6979  return __pyx_r;
6980 }
6981 
6982 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
6983  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6984  *
6985  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6986  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6987  *
6988  */
6989 
6990 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
6991  PyObject *__pyx_r = NULL;
6992  __Pyx_RefNannyDeclarations
6993  PyObject *__pyx_t_1 = NULL;
6994  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
6995 
6996  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
6997  *
6998  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6999  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
7000  *
7001  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7002  */
7003  __Pyx_XDECREF(__pyx_r);
7004  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 831, __pyx_L1_error)
7005  __Pyx_GOTREF(__pyx_t_1);
7006  __pyx_r = __pyx_t_1;
7007  __pyx_t_1 = 0;
7008  goto __pyx_L0;
7009 
7010  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
7011  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7012  *
7013  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7014  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7015  *
7016  */
7017 
7018  /* function exit code */
7019  __pyx_L1_error:;
7020  __Pyx_XDECREF(__pyx_t_1);
7021  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7022  __pyx_r = 0;
7023  __pyx_L0:;
7024  __Pyx_XGIVEREF(__pyx_r);
7025  __Pyx_RefNannyFinishContext();
7026  return __pyx_r;
7027 }
7028 
7029 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
7030  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7031  *
7032  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7033  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7034  *
7035  */
7036 
7037 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
7038  PyObject *__pyx_r = NULL;
7039  __Pyx_RefNannyDeclarations
7040  PyObject *__pyx_t_1 = NULL;
7041  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
7042 
7043  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
7044  *
7045  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7046  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
7047  *
7048  * cdef inline tuple PyDataType_SHAPE(dtype d):
7049  */
7050  __Pyx_XDECREF(__pyx_r);
7051  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 834, __pyx_L1_error)
7052  __Pyx_GOTREF(__pyx_t_1);
7053  __pyx_r = __pyx_t_1;
7054  __pyx_t_1 = 0;
7055  goto __pyx_L0;
7056 
7057  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
7058  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7059  *
7060  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7061  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7062  *
7063  */
7064 
7065  /* function exit code */
7066  __pyx_L1_error:;
7067  __Pyx_XDECREF(__pyx_t_1);
7068  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7069  __pyx_r = 0;
7070  __pyx_L0:;
7071  __Pyx_XGIVEREF(__pyx_r);
7072  __Pyx_RefNannyFinishContext();
7073  return __pyx_r;
7074 }
7075 
7076 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
7077  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7078  *
7079  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7080  * if PyDataType_HASSUBARRAY(d):
7081  * return <tuple>d.subarray.shape
7082  */
7083 
7084 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7085  PyObject *__pyx_r = NULL;
7086  __Pyx_RefNannyDeclarations
7087  int __pyx_t_1;
7088  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
7089 
7090  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
7091  *
7092  * cdef inline tuple PyDataType_SHAPE(dtype d):
7093  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7094  * return <tuple>d.subarray.shape
7095  * else:
7096  */
7097  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7098  if (__pyx_t_1) {
7099 
7100  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
7101  * cdef inline tuple PyDataType_SHAPE(dtype d):
7102  * if PyDataType_HASSUBARRAY(d):
7103  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
7104  * else:
7105  * return ()
7106  */
7107  __Pyx_XDECREF(__pyx_r);
7108  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7109  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7110  goto __pyx_L0;
7111 
7112  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
7113  *
7114  * cdef inline tuple PyDataType_SHAPE(dtype d):
7115  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7116  * return <tuple>d.subarray.shape
7117  * else:
7118  */
7119  }
7120 
7121  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
7122  * return <tuple>d.subarray.shape
7123  * else:
7124  * return () # <<<<<<<<<<<<<<
7125  *
7126  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
7127  */
7128  /*else*/ {
7129  __Pyx_XDECREF(__pyx_r);
7130  __Pyx_INCREF(__pyx_empty_tuple);
7131  __pyx_r = __pyx_empty_tuple;
7132  goto __pyx_L0;
7133  }
7134 
7135  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
7136  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7137  *
7138  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7139  * if PyDataType_HASSUBARRAY(d):
7140  * return <tuple>d.subarray.shape
7141  */
7142 
7143  /* function exit code */
7144  __pyx_L0:;
7145  __Pyx_XGIVEREF(__pyx_r);
7146  __Pyx_RefNannyFinishContext();
7147  return __pyx_r;
7148 }
7149 
7150 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
7151  * return ()
7152  *
7153  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
7154  * # Recursive utility function used in __getbuffer__ to get format
7155  * # string. The new location in the format string is returned.
7156  */
7157 
7158 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
7159  PyArray_Descr *__pyx_v_child = 0;
7160  int __pyx_v_endian_detector;
7161  int __pyx_v_little_endian;
7162  PyObject *__pyx_v_fields = 0;
7163  PyObject *__pyx_v_childname = NULL;
7164  PyObject *__pyx_v_new_offset = NULL;
7165  PyObject *__pyx_v_t = NULL;
7166  char *__pyx_r;
7167  __Pyx_RefNannyDeclarations
7168  PyObject *__pyx_t_1 = NULL;
7169  Py_ssize_t __pyx_t_2;
7170  PyObject *__pyx_t_3 = NULL;
7171  PyObject *__pyx_t_4 = NULL;
7172  int __pyx_t_5;
7173  int __pyx_t_6;
7174  int __pyx_t_7;
7175  long __pyx_t_8;
7176  char *__pyx_t_9;
7177  __Pyx_RefNannySetupContext("_util_dtypestring", 0);
7178 
7179  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":847
7180  *
7181  * cdef dtype child
7182  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
7183  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
7184  * cdef tuple fields
7185  */
7186  __pyx_v_endian_detector = 1;
7187 
7188  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":848
7189  * cdef dtype child
7190  * cdef int endian_detector = 1
7191  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
7192  * cdef tuple fields
7193  *
7194  */
7195  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
7196 
7197  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
7198  * cdef tuple fields
7199  *
7200  * for childname in descr.names: # <<<<<<<<<<<<<<
7201  * fields = descr.fields[childname]
7202  * child, new_offset = fields
7203  */
7204  if (unlikely(__pyx_v_descr->names == Py_None)) {
7205  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
7206  __PYX_ERR(2, 851, __pyx_L1_error)
7207  }
7208  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
7209  for (;;) {
7210  if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
7211  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7212  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 851, __pyx_L1_error)
7213  #else
7214  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 851, __pyx_L1_error)
7215  __Pyx_GOTREF(__pyx_t_3);
7216  #endif
7217  __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
7218  __pyx_t_3 = 0;
7219 
7220  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":852
7221  *
7222  * for childname in descr.names:
7223  * fields = descr.fields[childname] # <<<<<<<<<<<<<<
7224  * child, new_offset = fields
7225  *
7226  */
7227  if (unlikely(__pyx_v_descr->fields == Py_None)) {
7228  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7229  __PYX_ERR(2, 852, __pyx_L1_error)
7230  }
7231  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 852, __pyx_L1_error)
7232  __Pyx_GOTREF(__pyx_t_3);
7233  if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 852, __pyx_L1_error)
7234  __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
7235  __pyx_t_3 = 0;
7236 
7237  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":853
7238  * for childname in descr.names:
7239  * fields = descr.fields[childname]
7240  * child, new_offset = fields # <<<<<<<<<<<<<<
7241  *
7242  * if (end - f) - <int>(new_offset - offset[0]) < 15:
7243  */
7244  if (likely(__pyx_v_fields != Py_None)) {
7245  PyObject* sequence = __pyx_v_fields;
7246  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7247  if (unlikely(size != 2)) {
7248  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7249  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7250  __PYX_ERR(2, 853, __pyx_L1_error)
7251  }
7252  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7253  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
7254  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
7255  __Pyx_INCREF(__pyx_t_3);
7256  __Pyx_INCREF(__pyx_t_4);
7257  #else
7258  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 853, __pyx_L1_error)
7259  __Pyx_GOTREF(__pyx_t_3);
7260  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 853, __pyx_L1_error)
7261  __Pyx_GOTREF(__pyx_t_4);
7262  #endif
7263  } else {
7264  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 853, __pyx_L1_error)
7265  }
7266  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 853, __pyx_L1_error)
7267  __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
7268  __pyx_t_3 = 0;
7269  __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
7270  __pyx_t_4 = 0;
7271 
7272  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
7273  * child, new_offset = fields
7274  *
7275  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
7276  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7277  *
7278  */
7279  __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 855, __pyx_L1_error)
7280  __Pyx_GOTREF(__pyx_t_4);
7281  __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 855, __pyx_L1_error)
7282  __Pyx_GOTREF(__pyx_t_3);
7283  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7284  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 855, __pyx_L1_error)
7285  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7286  __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
7287  if (unlikely(__pyx_t_6)) {
7288 
7289  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
7290  *
7291  * if (end - f) - <int>(new_offset - offset[0]) < 15:
7292  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
7293  *
7294  * if ((child.byteorder == c'>' and little_endian) or
7295  */
7296  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 856, __pyx_L1_error)
7297  __Pyx_GOTREF(__pyx_t_3);
7298  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7299  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7300  __PYX_ERR(2, 856, __pyx_L1_error)
7301 
7302  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
7303  * child, new_offset = fields
7304  *
7305  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
7306  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7307  *
7308  */
7309  }
7310 
7311  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
7312  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7313  *
7314  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7315  * (child.byteorder == c'<' and not little_endian)):
7316  * raise ValueError(u"Non-native byte order not supported")
7317  */
7318  __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
7319  if (!__pyx_t_7) {
7320  goto __pyx_L8_next_or;
7321  } else {
7322  }
7323  __pyx_t_7 = (__pyx_v_little_endian != 0);
7324  if (!__pyx_t_7) {
7325  } else {
7326  __pyx_t_6 = __pyx_t_7;
7327  goto __pyx_L7_bool_binop_done;
7328  }
7329  __pyx_L8_next_or:;
7330 
7331  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":859
7332  *
7333  * if ((child.byteorder == c'>' and little_endian) or
7334  * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
7335  * raise ValueError(u"Non-native byte order not supported")
7336  * # One could encode it in the format string and have Cython
7337  */
7338  __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
7339  if (__pyx_t_7) {
7340  } else {
7341  __pyx_t_6 = __pyx_t_7;
7342  goto __pyx_L7_bool_binop_done;
7343  }
7344  __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
7345  __pyx_t_6 = __pyx_t_7;
7346  __pyx_L7_bool_binop_done:;
7347 
7348  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
7349  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7350  *
7351  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7352  * (child.byteorder == c'<' and not little_endian)):
7353  * raise ValueError(u"Non-native byte order not supported")
7354  */
7355  if (unlikely(__pyx_t_6)) {
7356 
7357  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":860
7358  * if ((child.byteorder == c'>' and little_endian) or
7359  * (child.byteorder == c'<' and not little_endian)):
7360  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
7361  * # One could encode it in the format string and have Cython
7362  * # complain instead, BUT: < and > in format strings also imply
7363  */
7364  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 860, __pyx_L1_error)
7365  __Pyx_GOTREF(__pyx_t_3);
7366  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7367  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7368  __PYX_ERR(2, 860, __pyx_L1_error)
7369 
7370  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
7371  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
7372  *
7373  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7374  * (child.byteorder == c'<' and not little_endian)):
7375  * raise ValueError(u"Non-native byte order not supported")
7376  */
7377  }
7378 
7379  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":870
7380  *
7381  * # Output padding bytes
7382  * while offset[0] < new_offset: # <<<<<<<<<<<<<<
7383  * f[0] = 120 # "x"; pad byte
7384  * f += 1
7385  */
7386  while (1) {
7387  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 870, __pyx_L1_error)
7388  __Pyx_GOTREF(__pyx_t_3);
7389  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 870, __pyx_L1_error)
7390  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7391  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 870, __pyx_L1_error)
7392  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7393  if (!__pyx_t_6) break;
7394 
7395  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":871
7396  * # Output padding bytes
7397  * while offset[0] < new_offset:
7398  * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
7399  * f += 1
7400  * offset[0] += 1
7401  */
7402  (__pyx_v_f[0]) = 0x78;
7403 
7404  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":872
7405  * while offset[0] < new_offset:
7406  * f[0] = 120 # "x"; pad byte
7407  * f += 1 # <<<<<<<<<<<<<<
7408  * offset[0] += 1
7409  *
7410  */
7411  __pyx_v_f = (__pyx_v_f + 1);
7412 
7413  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":873
7414  * f[0] = 120 # "x"; pad byte
7415  * f += 1
7416  * offset[0] += 1 # <<<<<<<<<<<<<<
7417  *
7418  * offset[0] += child.itemsize
7419  */
7420  __pyx_t_8 = 0;
7421  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
7422  }
7423 
7424  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":875
7425  * offset[0] += 1
7426  *
7427  * offset[0] += child.itemsize # <<<<<<<<<<<<<<
7428  *
7429  * if not PyDataType_HASFIELDS(child):
7430  */
7431  __pyx_t_8 = 0;
7432  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
7433 
7434  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":877
7435  * offset[0] += child.itemsize
7436  *
7437  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
7438  * t = child.type_num
7439  * if end - f < 5:
7440  */
7441  __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
7442  if (__pyx_t_6) {
7443 
7444  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":878
7445  *
7446  * if not PyDataType_HASFIELDS(child):
7447  * t = child.type_num # <<<<<<<<<<<<<<
7448  * if end - f < 5:
7449  * raise RuntimeError(u"Format string allocated too short.")
7450  */
7451  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 878, __pyx_L1_error)
7452  __Pyx_GOTREF(__pyx_t_4);
7453  __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
7454  __pyx_t_4 = 0;
7455 
7456  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
7457  * if not PyDataType_HASFIELDS(child):
7458  * t = child.type_num
7459  * if end - f < 5: # <<<<<<<<<<<<<<
7460  * raise RuntimeError(u"Format string allocated too short.")
7461  *
7462  */
7463  __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
7464  if (unlikely(__pyx_t_6)) {
7465 
7466  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":880
7467  * t = child.type_num
7468  * if end - f < 5:
7469  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
7470  *
7471  * # Until ticket #99 is fixed, use integers to avoid warnings
7472  */
7473  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 880, __pyx_L1_error)
7474  __Pyx_GOTREF(__pyx_t_4);
7475  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7476  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7477  __PYX_ERR(2, 880, __pyx_L1_error)
7478 
7479  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
7480  * if not PyDataType_HASFIELDS(child):
7481  * t = child.type_num
7482  * if end - f < 5: # <<<<<<<<<<<<<<
7483  * raise RuntimeError(u"Format string allocated too short.")
7484  *
7485  */
7486  }
7487 
7488  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":883
7489  *
7490  * # Until ticket #99 is fixed, use integers to avoid warnings
7491  * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
7492  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7493  * elif t == NPY_SHORT: f[0] = 104 #"h"
7494  */
7495  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 883, __pyx_L1_error)
7496  __Pyx_GOTREF(__pyx_t_4);
7497  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 883, __pyx_L1_error)
7498  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7499  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 883, __pyx_L1_error)
7500  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7501  if (__pyx_t_6) {
7502  (__pyx_v_f[0]) = 98;
7503  goto __pyx_L15;
7504  }
7505 
7506  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":884
7507  * # Until ticket #99 is fixed, use integers to avoid warnings
7508  * if t == NPY_BYTE: f[0] = 98 #"b"
7509  * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
7510  * elif t == NPY_SHORT: f[0] = 104 #"h"
7511  * elif t == NPY_USHORT: f[0] = 72 #"H"
7512  */
7513  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 884, __pyx_L1_error)
7514  __Pyx_GOTREF(__pyx_t_3);
7515  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 884, __pyx_L1_error)
7516  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7517  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 884, __pyx_L1_error)
7518  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7519  if (__pyx_t_6) {
7520  (__pyx_v_f[0]) = 66;
7521  goto __pyx_L15;
7522  }
7523 
7524  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":885
7525  * if t == NPY_BYTE: f[0] = 98 #"b"
7526  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7527  * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
7528  * elif t == NPY_USHORT: f[0] = 72 #"H"
7529  * elif t == NPY_INT: f[0] = 105 #"i"
7530  */
7531  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 885, __pyx_L1_error)
7532  __Pyx_GOTREF(__pyx_t_4);
7533  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 885, __pyx_L1_error)
7534  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7535  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 885, __pyx_L1_error)
7536  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7537  if (__pyx_t_6) {
7538  (__pyx_v_f[0]) = 0x68;
7539  goto __pyx_L15;
7540  }
7541 
7542  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":886
7543  * elif t == NPY_UBYTE: f[0] = 66 #"B"
7544  * elif t == NPY_SHORT: f[0] = 104 #"h"
7545  * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
7546  * elif t == NPY_INT: f[0] = 105 #"i"
7547  * elif t == NPY_UINT: f[0] = 73 #"I"
7548  */
7549  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 886, __pyx_L1_error)
7550  __Pyx_GOTREF(__pyx_t_3);
7551  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 886, __pyx_L1_error)
7552  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7553  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 886, __pyx_L1_error)
7554  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7555  if (__pyx_t_6) {
7556  (__pyx_v_f[0]) = 72;
7557  goto __pyx_L15;
7558  }
7559 
7560  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":887
7561  * elif t == NPY_SHORT: f[0] = 104 #"h"
7562  * elif t == NPY_USHORT: f[0] = 72 #"H"
7563  * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
7564  * elif t == NPY_UINT: f[0] = 73 #"I"
7565  * elif t == NPY_LONG: f[0] = 108 #"l"
7566  */
7567  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 887, __pyx_L1_error)
7568  __Pyx_GOTREF(__pyx_t_4);
7569  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 887, __pyx_L1_error)
7570  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7571  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 887, __pyx_L1_error)
7572  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7573  if (__pyx_t_6) {
7574  (__pyx_v_f[0]) = 0x69;
7575  goto __pyx_L15;
7576  }
7577 
7578  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":888
7579  * elif t == NPY_USHORT: f[0] = 72 #"H"
7580  * elif t == NPY_INT: f[0] = 105 #"i"
7581  * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
7582  * elif t == NPY_LONG: f[0] = 108 #"l"
7583  * elif t == NPY_ULONG: f[0] = 76 #"L"
7584  */
7585  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 888, __pyx_L1_error)
7586  __Pyx_GOTREF(__pyx_t_3);
7587  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 888, __pyx_L1_error)
7588  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7589  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 888, __pyx_L1_error)
7590  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7591  if (__pyx_t_6) {
7592  (__pyx_v_f[0]) = 73;
7593  goto __pyx_L15;
7594  }
7595 
7596  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":889
7597  * elif t == NPY_INT: f[0] = 105 #"i"
7598  * elif t == NPY_UINT: f[0] = 73 #"I"
7599  * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
7600  * elif t == NPY_ULONG: f[0] = 76 #"L"
7601  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7602  */
7603  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 889, __pyx_L1_error)
7604  __Pyx_GOTREF(__pyx_t_4);
7605  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 889, __pyx_L1_error)
7606  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7607  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 889, __pyx_L1_error)
7608  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7609  if (__pyx_t_6) {
7610  (__pyx_v_f[0]) = 0x6C;
7611  goto __pyx_L15;
7612  }
7613 
7614  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":890
7615  * elif t == NPY_UINT: f[0] = 73 #"I"
7616  * elif t == NPY_LONG: f[0] = 108 #"l"
7617  * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
7618  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7619  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7620  */
7621  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 890, __pyx_L1_error)
7622  __Pyx_GOTREF(__pyx_t_3);
7623  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 890, __pyx_L1_error)
7624  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7625  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 890, __pyx_L1_error)
7626  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7627  if (__pyx_t_6) {
7628  (__pyx_v_f[0]) = 76;
7629  goto __pyx_L15;
7630  }
7631 
7632  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":891
7633  * elif t == NPY_LONG: f[0] = 108 #"l"
7634  * elif t == NPY_ULONG: f[0] = 76 #"L"
7635  * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
7636  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7637  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7638  */
7639  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 891, __pyx_L1_error)
7640  __Pyx_GOTREF(__pyx_t_4);
7641  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 891, __pyx_L1_error)
7642  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7643  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 891, __pyx_L1_error)
7644  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7645  if (__pyx_t_6) {
7646  (__pyx_v_f[0]) = 0x71;
7647  goto __pyx_L15;
7648  }
7649 
7650  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":892
7651  * elif t == NPY_ULONG: f[0] = 76 #"L"
7652  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7653  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
7654  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7655  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7656  */
7657  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 892, __pyx_L1_error)
7658  __Pyx_GOTREF(__pyx_t_3);
7659  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 892, __pyx_L1_error)
7660  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7661  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 892, __pyx_L1_error)
7662  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7663  if (__pyx_t_6) {
7664  (__pyx_v_f[0]) = 81;
7665  goto __pyx_L15;
7666  }
7667 
7668  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":893
7669  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7670  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7671  * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
7672  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7673  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7674  */
7675  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 893, __pyx_L1_error)
7676  __Pyx_GOTREF(__pyx_t_4);
7677  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 893, __pyx_L1_error)
7678  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7679  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 893, __pyx_L1_error)
7680  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7681  if (__pyx_t_6) {
7682  (__pyx_v_f[0]) = 0x66;
7683  goto __pyx_L15;
7684  }
7685 
7686  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":894
7687  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7688  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7689  * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
7690  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7691  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7692  */
7693  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 894, __pyx_L1_error)
7694  __Pyx_GOTREF(__pyx_t_3);
7695  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 894, __pyx_L1_error)
7696  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7697  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 894, __pyx_L1_error)
7698  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7699  if (__pyx_t_6) {
7700  (__pyx_v_f[0]) = 0x64;
7701  goto __pyx_L15;
7702  }
7703 
7704  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":895
7705  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7706  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7707  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
7708  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7709  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7710  */
7711  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 895, __pyx_L1_error)
7712  __Pyx_GOTREF(__pyx_t_4);
7713  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 895, __pyx_L1_error)
7714  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7715  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 895, __pyx_L1_error)
7716  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7717  if (__pyx_t_6) {
7718  (__pyx_v_f[0]) = 0x67;
7719  goto __pyx_L15;
7720  }
7721 
7722  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":896
7723  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7724  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7725  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
7726  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7727  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7728  */
7729  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 896, __pyx_L1_error)
7730  __Pyx_GOTREF(__pyx_t_3);
7731  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 896, __pyx_L1_error)
7732  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7733  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 896, __pyx_L1_error)
7734  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7735  if (__pyx_t_6) {
7736  (__pyx_v_f[0]) = 90;
7737  (__pyx_v_f[1]) = 0x66;
7738  __pyx_v_f = (__pyx_v_f + 1);
7739  goto __pyx_L15;
7740  }
7741 
7742  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":897
7743  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7744  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7745  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
7746  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7747  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7748  */
7749  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 897, __pyx_L1_error)
7750  __Pyx_GOTREF(__pyx_t_4);
7751  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 897, __pyx_L1_error)
7752  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7753  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 897, __pyx_L1_error)
7754  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7755  if (__pyx_t_6) {
7756  (__pyx_v_f[0]) = 90;
7757  (__pyx_v_f[1]) = 0x64;
7758  __pyx_v_f = (__pyx_v_f + 1);
7759  goto __pyx_L15;
7760  }
7761 
7762  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":898
7763  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7764  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7765  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
7766  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7767  * else:
7768  */
7769  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 898, __pyx_L1_error)
7770  __Pyx_GOTREF(__pyx_t_3);
7771  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 898, __pyx_L1_error)
7772  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7773  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 898, __pyx_L1_error)
7774  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7775  if (__pyx_t_6) {
7776  (__pyx_v_f[0]) = 90;
7777  (__pyx_v_f[1]) = 0x67;
7778  __pyx_v_f = (__pyx_v_f + 1);
7779  goto __pyx_L15;
7780  }
7781 
7782  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":899
7783  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7784  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7785  * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
7786  * else:
7787  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7788  */
7789  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 899, __pyx_L1_error)
7790  __Pyx_GOTREF(__pyx_t_4);
7791  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 899, __pyx_L1_error)
7792  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7793  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 899, __pyx_L1_error)
7794  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7795  if (likely(__pyx_t_6)) {
7796  (__pyx_v_f[0]) = 79;
7797  goto __pyx_L15;
7798  }
7799 
7800  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":901
7801  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7802  * else:
7803  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
7804  * f += 1
7805  * else:
7806  */
7807  /*else*/ {
7808  __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 901, __pyx_L1_error)
7809  __Pyx_GOTREF(__pyx_t_3);
7810  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 901, __pyx_L1_error)
7811  __Pyx_GOTREF(__pyx_t_4);
7812  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7813  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7814  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7815  __PYX_ERR(2, 901, __pyx_L1_error)
7816  }
7817  __pyx_L15:;
7818 
7819  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":902
7820  * else:
7821  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7822  * f += 1 # <<<<<<<<<<<<<<
7823  * else:
7824  * # Cython ignores struct boundary information ("T{...}"),
7825  */
7826  __pyx_v_f = (__pyx_v_f + 1);
7827 
7828  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":877
7829  * offset[0] += child.itemsize
7830  *
7831  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
7832  * t = child.type_num
7833  * if end - f < 5:
7834  */
7835  goto __pyx_L13;
7836  }
7837 
7838  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":906
7839  * # Cython ignores struct boundary information ("T{...}"),
7840  * # so don't output it
7841  * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
7842  * return f
7843  *
7844  */
7845  /*else*/ {
7846  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(2, 906, __pyx_L1_error)
7847  __pyx_v_f = __pyx_t_9;
7848  }
7849  __pyx_L13:;
7850 
7851  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
7852  * cdef tuple fields
7853  *
7854  * for childname in descr.names: # <<<<<<<<<<<<<<
7855  * fields = descr.fields[childname]
7856  * child, new_offset = fields
7857  */
7858  }
7859  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7860 
7861  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":907
7862  * # so don't output it
7863  * f = _util_dtypestring(child, f, end, offset)
7864  * return f # <<<<<<<<<<<<<<
7865  *
7866  *
7867  */
7868  __pyx_r = __pyx_v_f;
7869  goto __pyx_L0;
7870 
7871  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
7872  * return ()
7873  *
7874  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
7875  * # Recursive utility function used in __getbuffer__ to get format
7876  * # string. The new location in the format string is returned.
7877  */
7878 
7879  /* function exit code */
7880  __pyx_L1_error:;
7881  __Pyx_XDECREF(__pyx_t_1);
7882  __Pyx_XDECREF(__pyx_t_3);
7883  __Pyx_XDECREF(__pyx_t_4);
7884  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
7885  __pyx_r = NULL;
7886  __pyx_L0:;
7887  __Pyx_XDECREF((PyObject *)__pyx_v_child);
7888  __Pyx_XDECREF(__pyx_v_fields);
7889  __Pyx_XDECREF(__pyx_v_childname);
7890  __Pyx_XDECREF(__pyx_v_new_offset);
7891  __Pyx_XDECREF(__pyx_v_t);
7892  __Pyx_RefNannyFinishContext();
7893  return __pyx_r;
7894 }
7895 
7896 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022
7897  * int _import_umath() except -1
7898  *
7899  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7900  * Py_INCREF(base) # important to do this before stealing the reference below!
7901  * PyArray_SetBaseObject(arr, base)
7902  */
7903 
7904 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7905  __Pyx_RefNannyDeclarations
7906  __Pyx_RefNannySetupContext("set_array_base", 0);
7907 
7908  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1023
7909  *
7910  * cdef inline void set_array_base(ndarray arr, object base):
7911  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
7912  * PyArray_SetBaseObject(arr, base)
7913  *
7914  */
7915  Py_INCREF(__pyx_v_base);
7916 
7917  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1024
7918  * cdef inline void set_array_base(ndarray arr, object base):
7919  * Py_INCREF(base) # important to do this before stealing the reference below!
7920  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
7921  *
7922  * cdef inline object get_array_base(ndarray arr):
7923  */
7924  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
7925 
7926  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022
7927  * int _import_umath() except -1
7928  *
7929  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7930  * Py_INCREF(base) # important to do this before stealing the reference below!
7931  * PyArray_SetBaseObject(arr, base)
7932  */
7933 
7934  /* function exit code */
7935  __Pyx_RefNannyFinishContext();
7936 }
7937 
7938 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1026
7939  * PyArray_SetBaseObject(arr, base)
7940  *
7941  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7942  * base = PyArray_BASE(arr)
7943  * if base is NULL:
7944  */
7945 
7946 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7947  PyObject *__pyx_v_base;
7948  PyObject *__pyx_r = NULL;
7949  __Pyx_RefNannyDeclarations
7950  int __pyx_t_1;
7951  __Pyx_RefNannySetupContext("get_array_base", 0);
7952 
7953  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1027
7954  *
7955  * cdef inline object get_array_base(ndarray arr):
7956  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
7957  * if base is NULL:
7958  * return None
7959  */
7960  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
7961 
7962  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028
7963  * cdef inline object get_array_base(ndarray arr):
7964  * base = PyArray_BASE(arr)
7965  * if base is NULL: # <<<<<<<<<<<<<<
7966  * return None
7967  * return <object>base
7968  */
7969  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
7970  if (__pyx_t_1) {
7971 
7972  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1029
7973  * base = PyArray_BASE(arr)
7974  * if base is NULL:
7975  * return None # <<<<<<<<<<<<<<
7976  * return <object>base
7977  *
7978  */
7979  __Pyx_XDECREF(__pyx_r);
7980  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7981  goto __pyx_L0;
7982 
7983  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028
7984  * cdef inline object get_array_base(ndarray arr):
7985  * base = PyArray_BASE(arr)
7986  * if base is NULL: # <<<<<<<<<<<<<<
7987  * return None
7988  * return <object>base
7989  */
7990  }
7991 
7992  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1030
7993  * if base is NULL:
7994  * return None
7995  * return <object>base # <<<<<<<<<<<<<<
7996  *
7997  * # Versions of the import_* functions which are more suitable for
7998  */
7999  __Pyx_XDECREF(__pyx_r);
8000  __Pyx_INCREF(((PyObject *)__pyx_v_base));
8001  __pyx_r = ((PyObject *)__pyx_v_base);
8002  goto __pyx_L0;
8003 
8004  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1026
8005  * PyArray_SetBaseObject(arr, base)
8006  *
8007  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
8008  * base = PyArray_BASE(arr)
8009  * if base is NULL:
8010  */
8011 
8012  /* function exit code */
8013  __pyx_L0:;
8014  __Pyx_XGIVEREF(__pyx_r);
8015  __Pyx_RefNannyFinishContext();
8016  return __pyx_r;
8017 }
8018 
8019 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
8020  * # Versions of the import_* functions which are more suitable for
8021  * # Cython code.
8022  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
8023  * try:
8024  * _import_array()
8025  */
8026 
8027 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
8028  int __pyx_r;
8029  __Pyx_RefNannyDeclarations
8030  PyObject *__pyx_t_1 = NULL;
8031  PyObject *__pyx_t_2 = NULL;
8032  PyObject *__pyx_t_3 = NULL;
8033  int __pyx_t_4;
8034  PyObject *__pyx_t_5 = NULL;
8035  PyObject *__pyx_t_6 = NULL;
8036  PyObject *__pyx_t_7 = NULL;
8037  PyObject *__pyx_t_8 = NULL;
8038  __Pyx_RefNannySetupContext("import_array", 0);
8039 
8040  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
8041  * # Cython code.
8042  * cdef inline int import_array() except -1:
8043  * try: # <<<<<<<<<<<<<<
8044  * _import_array()
8045  * except Exception:
8046  */
8047  {
8048  __Pyx_PyThreadState_declare
8049  __Pyx_PyThreadState_assign
8050  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8051  __Pyx_XGOTREF(__pyx_t_1);
8052  __Pyx_XGOTREF(__pyx_t_2);
8053  __Pyx_XGOTREF(__pyx_t_3);
8054  /*try:*/ {
8055 
8056  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1036
8057  * cdef inline int import_array() except -1:
8058  * try:
8059  * _import_array() # <<<<<<<<<<<<<<
8060  * except Exception:
8061  * raise ImportError("numpy.core.multiarray failed to import")
8062  */
8063  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1036, __pyx_L3_error)
8064 
8065  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
8066  * # Cython code.
8067  * cdef inline int import_array() except -1:
8068  * try: # <<<<<<<<<<<<<<
8069  * _import_array()
8070  * except Exception:
8071  */
8072  }
8073  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8074  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8075  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8076  goto __pyx_L8_try_end;
8077  __pyx_L3_error:;
8078 
8079  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1037
8080  * try:
8081  * _import_array()
8082  * except Exception: # <<<<<<<<<<<<<<
8083  * raise ImportError("numpy.core.multiarray failed to import")
8084  *
8085  */
8086  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8087  if (__pyx_t_4) {
8088  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8089  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1037, __pyx_L5_except_error)
8090  __Pyx_GOTREF(__pyx_t_5);
8091  __Pyx_GOTREF(__pyx_t_6);
8092  __Pyx_GOTREF(__pyx_t_7);
8093 
8094  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038
8095  * _import_array()
8096  * except Exception:
8097  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
8098  *
8099  * cdef inline int import_umath() except -1:
8100  */
8101  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1038, __pyx_L5_except_error)
8102  __Pyx_GOTREF(__pyx_t_8);
8103  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8104  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8105  __PYX_ERR(2, 1038, __pyx_L5_except_error)
8106  }
8107  goto __pyx_L5_except_error;
8108  __pyx_L5_except_error:;
8109 
8110  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
8111  * # Cython code.
8112  * cdef inline int import_array() except -1:
8113  * try: # <<<<<<<<<<<<<<
8114  * _import_array()
8115  * except Exception:
8116  */
8117  __Pyx_XGIVEREF(__pyx_t_1);
8118  __Pyx_XGIVEREF(__pyx_t_2);
8119  __Pyx_XGIVEREF(__pyx_t_3);
8120  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8121  goto __pyx_L1_error;
8122  __pyx_L8_try_end:;
8123  }
8124 
8125  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
8126  * # Versions of the import_* functions which are more suitable for
8127  * # Cython code.
8128  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
8129  * try:
8130  * _import_array()
8131  */
8132 
8133  /* function exit code */
8134  __pyx_r = 0;
8135  goto __pyx_L0;
8136  __pyx_L1_error:;
8137  __Pyx_XDECREF(__pyx_t_5);
8138  __Pyx_XDECREF(__pyx_t_6);
8139  __Pyx_XDECREF(__pyx_t_7);
8140  __Pyx_XDECREF(__pyx_t_8);
8141  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
8142  __pyx_r = -1;
8143  __pyx_L0:;
8144  __Pyx_RefNannyFinishContext();
8145  return __pyx_r;
8146 }
8147 
8148 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
8149  * raise ImportError("numpy.core.multiarray failed to import")
8150  *
8151  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
8152  * try:
8153  * _import_umath()
8154  */
8155 
8156 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
8157  int __pyx_r;
8158  __Pyx_RefNannyDeclarations
8159  PyObject *__pyx_t_1 = NULL;
8160  PyObject *__pyx_t_2 = NULL;
8161  PyObject *__pyx_t_3 = NULL;
8162  int __pyx_t_4;
8163  PyObject *__pyx_t_5 = NULL;
8164  PyObject *__pyx_t_6 = NULL;
8165  PyObject *__pyx_t_7 = NULL;
8166  PyObject *__pyx_t_8 = NULL;
8167  __Pyx_RefNannySetupContext("import_umath", 0);
8168 
8169  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
8170  *
8171  * cdef inline int import_umath() except -1:
8172  * try: # <<<<<<<<<<<<<<
8173  * _import_umath()
8174  * except Exception:
8175  */
8176  {
8177  __Pyx_PyThreadState_declare
8178  __Pyx_PyThreadState_assign
8179  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8180  __Pyx_XGOTREF(__pyx_t_1);
8181  __Pyx_XGOTREF(__pyx_t_2);
8182  __Pyx_XGOTREF(__pyx_t_3);
8183  /*try:*/ {
8184 
8185  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1042
8186  * cdef inline int import_umath() except -1:
8187  * try:
8188  * _import_umath() # <<<<<<<<<<<<<<
8189  * except Exception:
8190  * raise ImportError("numpy.core.umath failed to import")
8191  */
8192  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1042, __pyx_L3_error)
8193 
8194  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
8195  *
8196  * cdef inline int import_umath() except -1:
8197  * try: # <<<<<<<<<<<<<<
8198  * _import_umath()
8199  * except Exception:
8200  */
8201  }
8202  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8203  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8204  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8205  goto __pyx_L8_try_end;
8206  __pyx_L3_error:;
8207 
8208  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1043
8209  * try:
8210  * _import_umath()
8211  * except Exception: # <<<<<<<<<<<<<<
8212  * raise ImportError("numpy.core.umath failed to import")
8213  *
8214  */
8215  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8216  if (__pyx_t_4) {
8217  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8218  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1043, __pyx_L5_except_error)
8219  __Pyx_GOTREF(__pyx_t_5);
8220  __Pyx_GOTREF(__pyx_t_6);
8221  __Pyx_GOTREF(__pyx_t_7);
8222 
8223  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044
8224  * _import_umath()
8225  * except Exception:
8226  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8227  *
8228  * cdef inline int import_ufunc() except -1:
8229  */
8230  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1044, __pyx_L5_except_error)
8231  __Pyx_GOTREF(__pyx_t_8);
8232  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8233  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8234  __PYX_ERR(2, 1044, __pyx_L5_except_error)
8235  }
8236  goto __pyx_L5_except_error;
8237  __pyx_L5_except_error:;
8238 
8239  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
8240  *
8241  * cdef inline int import_umath() except -1:
8242  * try: # <<<<<<<<<<<<<<
8243  * _import_umath()
8244  * except Exception:
8245  */
8246  __Pyx_XGIVEREF(__pyx_t_1);
8247  __Pyx_XGIVEREF(__pyx_t_2);
8248  __Pyx_XGIVEREF(__pyx_t_3);
8249  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8250  goto __pyx_L1_error;
8251  __pyx_L8_try_end:;
8252  }
8253 
8254  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
8255  * raise ImportError("numpy.core.multiarray failed to import")
8256  *
8257  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
8258  * try:
8259  * _import_umath()
8260  */
8261 
8262  /* function exit code */
8263  __pyx_r = 0;
8264  goto __pyx_L0;
8265  __pyx_L1_error:;
8266  __Pyx_XDECREF(__pyx_t_5);
8267  __Pyx_XDECREF(__pyx_t_6);
8268  __Pyx_XDECREF(__pyx_t_7);
8269  __Pyx_XDECREF(__pyx_t_8);
8270  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8271  __pyx_r = -1;
8272  __pyx_L0:;
8273  __Pyx_RefNannyFinishContext();
8274  return __pyx_r;
8275 }
8276 
8277 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
8278  * raise ImportError("numpy.core.umath failed to import")
8279  *
8280  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8281  * try:
8282  * _import_umath()
8283  */
8284 
8285 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
8286  int __pyx_r;
8287  __Pyx_RefNannyDeclarations
8288  PyObject *__pyx_t_1 = NULL;
8289  PyObject *__pyx_t_2 = NULL;
8290  PyObject *__pyx_t_3 = NULL;
8291  int __pyx_t_4;
8292  PyObject *__pyx_t_5 = NULL;
8293  PyObject *__pyx_t_6 = NULL;
8294  PyObject *__pyx_t_7 = NULL;
8295  PyObject *__pyx_t_8 = NULL;
8296  __Pyx_RefNannySetupContext("import_ufunc", 0);
8297 
8298  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
8299  *
8300  * cdef inline int import_ufunc() except -1:
8301  * try: # <<<<<<<<<<<<<<
8302  * _import_umath()
8303  * except Exception:
8304  */
8305  {
8306  __Pyx_PyThreadState_declare
8307  __Pyx_PyThreadState_assign
8308  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8309  __Pyx_XGOTREF(__pyx_t_1);
8310  __Pyx_XGOTREF(__pyx_t_2);
8311  __Pyx_XGOTREF(__pyx_t_3);
8312  /*try:*/ {
8313 
8314  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1048
8315  * cdef inline int import_ufunc() except -1:
8316  * try:
8317  * _import_umath() # <<<<<<<<<<<<<<
8318  * except Exception:
8319  * raise ImportError("numpy.core.umath failed to import")
8320  */
8321  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1048, __pyx_L3_error)
8322 
8323  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
8324  *
8325  * cdef inline int import_ufunc() except -1:
8326  * try: # <<<<<<<<<<<<<<
8327  * _import_umath()
8328  * except Exception:
8329  */
8330  }
8331  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8332  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8333  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8334  goto __pyx_L8_try_end;
8335  __pyx_L3_error:;
8336 
8337  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1049
8338  * try:
8339  * _import_umath()
8340  * except Exception: # <<<<<<<<<<<<<<
8341  * raise ImportError("numpy.core.umath failed to import")
8342  */
8343  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8344  if (__pyx_t_4) {
8345  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8346  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1049, __pyx_L5_except_error)
8347  __Pyx_GOTREF(__pyx_t_5);
8348  __Pyx_GOTREF(__pyx_t_6);
8349  __Pyx_GOTREF(__pyx_t_7);
8350 
8351  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1050
8352  * _import_umath()
8353  * except Exception:
8354  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8355  */
8356  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1050, __pyx_L5_except_error)
8357  __Pyx_GOTREF(__pyx_t_8);
8358  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8359  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8360  __PYX_ERR(2, 1050, __pyx_L5_except_error)
8361  }
8362  goto __pyx_L5_except_error;
8363  __pyx_L5_except_error:;
8364 
8365  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
8366  *
8367  * cdef inline int import_ufunc() except -1:
8368  * try: # <<<<<<<<<<<<<<
8369  * _import_umath()
8370  * except Exception:
8371  */
8372  __Pyx_XGIVEREF(__pyx_t_1);
8373  __Pyx_XGIVEREF(__pyx_t_2);
8374  __Pyx_XGIVEREF(__pyx_t_3);
8375  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8376  goto __pyx_L1_error;
8377  __pyx_L8_try_end:;
8378  }
8379 
8380  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
8381  * raise ImportError("numpy.core.umath failed to import")
8382  *
8383  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8384  * try:
8385  * _import_umath()
8386  */
8387 
8388  /* function exit code */
8389  __pyx_r = 0;
8390  goto __pyx_L0;
8391  __pyx_L1_error:;
8392  __Pyx_XDECREF(__pyx_t_5);
8393  __Pyx_XDECREF(__pyx_t_6);
8394  __Pyx_XDECREF(__pyx_t_7);
8395  __Pyx_XDECREF(__pyx_t_8);
8396  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8397  __pyx_r = -1;
8398  __pyx_L0:;
8399  __Pyx_RefNannyFinishContext();
8400  return __pyx_r;
8401 }
8402 
8403 /* "View.MemoryView":122
8404  * cdef bint dtype_is_object
8405  *
8406  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8407  * mode="c", bint allocate_buffer=True):
8408  *
8409  */
8410 
8411 /* Python wrapper */
8412 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8413 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8414  PyObject *__pyx_v_shape = 0;
8415  Py_ssize_t __pyx_v_itemsize;
8416  PyObject *__pyx_v_format = 0;
8417  PyObject *__pyx_v_mode = 0;
8418  int __pyx_v_allocate_buffer;
8419  int __pyx_r;
8420  __Pyx_RefNannyDeclarations
8421  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8422  {
8423  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
8424  PyObject* values[5] = {0,0,0,0,0};
8425  values[3] = ((PyObject *)__pyx_n_s_c);
8426  if (unlikely(__pyx_kwds)) {
8427  Py_ssize_t kw_args;
8428  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8429  switch (pos_args) {
8430  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8431  CYTHON_FALLTHROUGH;
8432  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8433  CYTHON_FALLTHROUGH;
8434  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8435  CYTHON_FALLTHROUGH;
8436  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8437  CYTHON_FALLTHROUGH;
8438  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8439  CYTHON_FALLTHROUGH;
8440  case 0: break;
8441  default: goto __pyx_L5_argtuple_error;
8442  }
8443  kw_args = PyDict_Size(__pyx_kwds);
8444  switch (pos_args) {
8445  case 0:
8446  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
8447  else goto __pyx_L5_argtuple_error;
8448  CYTHON_FALLTHROUGH;
8449  case 1:
8450  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
8451  else {
8452  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
8453  }
8454  CYTHON_FALLTHROUGH;
8455  case 2:
8456  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
8457  else {
8458  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
8459  }
8460  CYTHON_FALLTHROUGH;
8461  case 3:
8462  if (kw_args > 0) {
8463  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
8464  if (value) { values[3] = value; kw_args--; }
8465  }
8466  CYTHON_FALLTHROUGH;
8467  case 4:
8468  if (kw_args > 0) {
8469  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
8470  if (value) { values[4] = value; kw_args--; }
8471  }
8472  }
8473  if (unlikely(kw_args > 0)) {
8474  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
8475  }
8476  } else {
8477  switch (PyTuple_GET_SIZE(__pyx_args)) {
8478  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8479  CYTHON_FALLTHROUGH;
8480  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8481  CYTHON_FALLTHROUGH;
8482  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8483  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8484  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8485  break;
8486  default: goto __pyx_L5_argtuple_error;
8487  }
8488  }
8489  __pyx_v_shape = ((PyObject*)values[0]);
8490  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
8491  __pyx_v_format = values[2];
8492  __pyx_v_mode = values[3];
8493  if (values[4]) {
8494  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
8495  } else {
8496 
8497  /* "View.MemoryView":123
8498  *
8499  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
8500  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
8501  *
8502  * cdef int idx
8503  */
8504  __pyx_v_allocate_buffer = ((int)1);
8505  }
8506  }
8507  goto __pyx_L4_argument_unpacking_done;
8508  __pyx_L5_argtuple_error:;
8509  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
8510  __pyx_L3_error:;
8511  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8512  __Pyx_RefNannyFinishContext();
8513  return -1;
8514  __pyx_L4_argument_unpacking_done:;
8515  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
8516  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
8517  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
8518  }
8519  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
8520 
8521  /* "View.MemoryView":122
8522  * cdef bint dtype_is_object
8523  *
8524  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8525  * mode="c", bint allocate_buffer=True):
8526  *
8527  */
8528 
8529  /* function exit code */
8530  goto __pyx_L0;
8531  __pyx_L1_error:;
8532  __pyx_r = -1;
8533  __pyx_L0:;
8534  __Pyx_RefNannyFinishContext();
8535  return __pyx_r;
8536 }
8537 
8538 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
8539  int __pyx_v_idx;
8540  Py_ssize_t __pyx_v_i;
8541  Py_ssize_t __pyx_v_dim;
8542  PyObject **__pyx_v_p;
8543  char __pyx_v_order;
8544  int __pyx_r;
8545  __Pyx_RefNannyDeclarations
8546  Py_ssize_t __pyx_t_1;
8547  int __pyx_t_2;
8548  PyObject *__pyx_t_3 = NULL;
8549  int __pyx_t_4;
8550  PyObject *__pyx_t_5 = NULL;
8551  PyObject *__pyx_t_6 = NULL;
8552  char *__pyx_t_7;
8553  int __pyx_t_8;
8554  Py_ssize_t __pyx_t_9;
8555  PyObject *__pyx_t_10 = NULL;
8556  Py_ssize_t __pyx_t_11;
8557  __Pyx_RefNannySetupContext("__cinit__", 0);
8558  __Pyx_INCREF(__pyx_v_format);
8559 
8560  /* "View.MemoryView":129
8561  * cdef PyObject **p
8562  *
8563  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
8564  * self.itemsize = itemsize
8565  *
8566  */
8567  if (unlikely(__pyx_v_shape == Py_None)) {
8568  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
8569  __PYX_ERR(1, 129, __pyx_L1_error)
8570  }
8571  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
8572  __pyx_v_self->ndim = ((int)__pyx_t_1);
8573 
8574  /* "View.MemoryView":130
8575  *
8576  * self.ndim = <int> len(shape)
8577  * self.itemsize = itemsize # <<<<<<<<<<<<<<
8578  *
8579  * if not self.ndim:
8580  */
8581  __pyx_v_self->itemsize = __pyx_v_itemsize;
8582 
8583  /* "View.MemoryView":132
8584  * self.itemsize = itemsize
8585  *
8586  * if not self.ndim: # <<<<<<<<<<<<<<
8587  * raise ValueError("Empty shape tuple for cython.array")
8588  *
8589  */
8590  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
8591  if (unlikely(__pyx_t_2)) {
8592 
8593  /* "View.MemoryView":133
8594  *
8595  * if not self.ndim:
8596  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
8597  *
8598  * if itemsize <= 0:
8599  */
8600  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
8601  __Pyx_GOTREF(__pyx_t_3);
8602  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8603  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8604  __PYX_ERR(1, 133, __pyx_L1_error)
8605 
8606  /* "View.MemoryView":132
8607  * self.itemsize = itemsize
8608  *
8609  * if not self.ndim: # <<<<<<<<<<<<<<
8610  * raise ValueError("Empty shape tuple for cython.array")
8611  *
8612  */
8613  }
8614 
8615  /* "View.MemoryView":135
8616  * raise ValueError("Empty shape tuple for cython.array")
8617  *
8618  * if itemsize <= 0: # <<<<<<<<<<<<<<
8619  * raise ValueError("itemsize <= 0 for cython.array")
8620  *
8621  */
8622  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8623  if (unlikely(__pyx_t_2)) {
8624 
8625  /* "View.MemoryView":136
8626  *
8627  * if itemsize <= 0:
8628  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
8629  *
8630  * if not isinstance(format, bytes):
8631  */
8632  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
8633  __Pyx_GOTREF(__pyx_t_3);
8634  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8635  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8636  __PYX_ERR(1, 136, __pyx_L1_error)
8637 
8638  /* "View.MemoryView":135
8639  * raise ValueError("Empty shape tuple for cython.array")
8640  *
8641  * if itemsize <= 0: # <<<<<<<<<<<<<<
8642  * raise ValueError("itemsize <= 0 for cython.array")
8643  *
8644  */
8645  }
8646 
8647  /* "View.MemoryView":138
8648  * raise ValueError("itemsize <= 0 for cython.array")
8649  *
8650  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8651  * format = format.encode('ASCII')
8652  * self._format = format # keep a reference to the byte string
8653  */
8654  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8655  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8656  if (__pyx_t_4) {
8657 
8658  /* "View.MemoryView":139
8659  *
8660  * if not isinstance(format, bytes):
8661  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
8662  * self._format = format # keep a reference to the byte string
8663  * self.format = self._format
8664  */
8665  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
8666  __Pyx_GOTREF(__pyx_t_5);
8667  __pyx_t_6 = NULL;
8668  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8669  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8670  if (likely(__pyx_t_6)) {
8671  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8672  __Pyx_INCREF(__pyx_t_6);
8673  __Pyx_INCREF(function);
8674  __Pyx_DECREF_SET(__pyx_t_5, function);
8675  }
8676  }
8677  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
8678  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8679  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
8680  __Pyx_GOTREF(__pyx_t_3);
8681  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8682  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
8683  __pyx_t_3 = 0;
8684 
8685  /* "View.MemoryView":138
8686  * raise ValueError("itemsize <= 0 for cython.array")
8687  *
8688  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8689  * format = format.encode('ASCII')
8690  * self._format = format # keep a reference to the byte string
8691  */
8692  }
8693 
8694  /* "View.MemoryView":140
8695  * if not isinstance(format, bytes):
8696  * format = format.encode('ASCII')
8697  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
8698  * self.format = self._format
8699  *
8700  */
8701  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
8702  __pyx_t_3 = __pyx_v_format;
8703  __Pyx_INCREF(__pyx_t_3);
8704  __Pyx_GIVEREF(__pyx_t_3);
8705  __Pyx_GOTREF(__pyx_v_self->_format);
8706  __Pyx_DECREF(__pyx_v_self->_format);
8707  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
8708  __pyx_t_3 = 0;
8709 
8710  /* "View.MemoryView":141
8711  * format = format.encode('ASCII')
8712  * self._format = format # keep a reference to the byte string
8713  * self.format = self._format # <<<<<<<<<<<<<<
8714  *
8715  *
8716  */
8717  if (unlikely(__pyx_v_self->_format == Py_None)) {
8718  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
8719  __PYX_ERR(1, 141, __pyx_L1_error)
8720  }
8721  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
8722  __pyx_v_self->format = __pyx_t_7;
8723 
8724  /* "View.MemoryView":144
8725  *
8726  *
8727  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
8728  * self._strides = self._shape + self.ndim
8729  *
8730  */
8731  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8732 
8733  /* "View.MemoryView":145
8734  *
8735  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
8736  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
8737  *
8738  * if not self._shape:
8739  */
8740  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8741 
8742  /* "View.MemoryView":147
8743  * self._strides = self._shape + self.ndim
8744  *
8745  * if not self._shape: # <<<<<<<<<<<<<<
8746  * raise MemoryError("unable to allocate shape and strides.")
8747  *
8748  */
8749  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8750  if (unlikely(__pyx_t_4)) {
8751 
8752  /* "View.MemoryView":148
8753  *
8754  * if not self._shape:
8755  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
8756  *
8757  *
8758  */
8759  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
8760  __Pyx_GOTREF(__pyx_t_3);
8761  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8762  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8763  __PYX_ERR(1, 148, __pyx_L1_error)
8764 
8765  /* "View.MemoryView":147
8766  * self._strides = self._shape + self.ndim
8767  *
8768  * if not self._shape: # <<<<<<<<<<<<<<
8769  * raise MemoryError("unable to allocate shape and strides.")
8770  *
8771  */
8772  }
8773 
8774  /* "View.MemoryView":151
8775  *
8776  *
8777  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8778  * if dim <= 0:
8779  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8780  */
8781  __pyx_t_8 = 0;
8782  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
8783  for (;;) {
8784  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
8785  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8786  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
8787  #else
8788  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
8789  __Pyx_GOTREF(__pyx_t_5);
8790  #endif
8791  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
8792  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8793  __pyx_v_dim = __pyx_t_9;
8794  __pyx_v_idx = __pyx_t_8;
8795  __pyx_t_8 = (__pyx_t_8 + 1);
8796 
8797  /* "View.MemoryView":152
8798  *
8799  * for idx, dim in enumerate(shape):
8800  * if dim <= 0: # <<<<<<<<<<<<<<
8801  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8802  * self._shape[idx] = dim
8803  */
8804  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8805  if (unlikely(__pyx_t_4)) {
8806 
8807  /* "View.MemoryView":153
8808  * for idx, dim in enumerate(shape):
8809  * if dim <= 0:
8810  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
8811  * self._shape[idx] = dim
8812  *
8813  */
8814  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
8815  __Pyx_GOTREF(__pyx_t_5);
8816  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8817  __Pyx_GOTREF(__pyx_t_6);
8818  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8819  __Pyx_GOTREF(__pyx_t_10);
8820  __Pyx_GIVEREF(__pyx_t_5);
8821  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
8822  __Pyx_GIVEREF(__pyx_t_6);
8823  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
8824  __pyx_t_5 = 0;
8825  __pyx_t_6 = 0;
8826  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8827  __Pyx_GOTREF(__pyx_t_6);
8828  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8829  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8830  __Pyx_GOTREF(__pyx_t_10);
8831  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8832  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8833  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8834  __PYX_ERR(1, 153, __pyx_L1_error)
8835 
8836  /* "View.MemoryView":152
8837  *
8838  * for idx, dim in enumerate(shape):
8839  * if dim <= 0: # <<<<<<<<<<<<<<
8840  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8841  * self._shape[idx] = dim
8842  */
8843  }
8844 
8845  /* "View.MemoryView":154
8846  * if dim <= 0:
8847  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8848  * self._shape[idx] = dim # <<<<<<<<<<<<<<
8849  *
8850  * cdef char order
8851  */
8852  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8853 
8854  /* "View.MemoryView":151
8855  *
8856  *
8857  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8858  * if dim <= 0:
8859  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8860  */
8861  }
8862  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8863 
8864  /* "View.MemoryView":157
8865  *
8866  * cdef char order
8867  * if mode == 'fortran': # <<<<<<<<<<<<<<
8868  * order = b'F'
8869  * self.mode = u'fortran'
8870  */
8871  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
8872  if (__pyx_t_4) {
8873 
8874  /* "View.MemoryView":158
8875  * cdef char order
8876  * if mode == 'fortran':
8877  * order = b'F' # <<<<<<<<<<<<<<
8878  * self.mode = u'fortran'
8879  * elif mode == 'c':
8880  */
8881  __pyx_v_order = 'F';
8882 
8883  /* "View.MemoryView":159
8884  * if mode == 'fortran':
8885  * order = b'F'
8886  * self.mode = u'fortran' # <<<<<<<<<<<<<<
8887  * elif mode == 'c':
8888  * order = b'C'
8889  */
8890  __Pyx_INCREF(__pyx_n_u_fortran);
8891  __Pyx_GIVEREF(__pyx_n_u_fortran);
8892  __Pyx_GOTREF(__pyx_v_self->mode);
8893  __Pyx_DECREF(__pyx_v_self->mode);
8894  __pyx_v_self->mode = __pyx_n_u_fortran;
8895 
8896  /* "View.MemoryView":157
8897  *
8898  * cdef char order
8899  * if mode == 'fortran': # <<<<<<<<<<<<<<
8900  * order = b'F'
8901  * self.mode = u'fortran'
8902  */
8903  goto __pyx_L10;
8904  }
8905 
8906  /* "View.MemoryView":160
8907  * order = b'F'
8908  * self.mode = u'fortran'
8909  * elif mode == 'c': # <<<<<<<<<<<<<<
8910  * order = b'C'
8911  * self.mode = u'c'
8912  */
8913  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
8914  if (likely(__pyx_t_4)) {
8915 
8916  /* "View.MemoryView":161
8917  * self.mode = u'fortran'
8918  * elif mode == 'c':
8919  * order = b'C' # <<<<<<<<<<<<<<
8920  * self.mode = u'c'
8921  * else:
8922  */
8923  __pyx_v_order = 'C';
8924 
8925  /* "View.MemoryView":162
8926  * elif mode == 'c':
8927  * order = b'C'
8928  * self.mode = u'c' # <<<<<<<<<<<<<<
8929  * else:
8930  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8931  */
8932  __Pyx_INCREF(__pyx_n_u_c);
8933  __Pyx_GIVEREF(__pyx_n_u_c);
8934  __Pyx_GOTREF(__pyx_v_self->mode);
8935  __Pyx_DECREF(__pyx_v_self->mode);
8936  __pyx_v_self->mode = __pyx_n_u_c;
8937 
8938  /* "View.MemoryView":160
8939  * order = b'F'
8940  * self.mode = u'fortran'
8941  * elif mode == 'c': # <<<<<<<<<<<<<<
8942  * order = b'C'
8943  * self.mode = u'c'
8944  */
8945  goto __pyx_L10;
8946  }
8947 
8948  /* "View.MemoryView":164
8949  * self.mode = u'c'
8950  * else:
8951  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
8952  *
8953  * self.len = fill_contig_strides_array(self._shape, self._strides,
8954  */
8955  /*else*/ {
8956  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
8957  __Pyx_GOTREF(__pyx_t_3);
8958  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
8959  __Pyx_GOTREF(__pyx_t_10);
8960  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8961  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8962  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8963  __PYX_ERR(1, 164, __pyx_L1_error)
8964  }
8965  __pyx_L10:;
8966 
8967  /* "View.MemoryView":166
8968  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8969  *
8970  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
8971  * itemsize, self.ndim, order)
8972  *
8973  */
8974  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
8975 
8976  /* "View.MemoryView":169
8977  * itemsize, self.ndim, order)
8978  *
8979  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
8980  * self.dtype_is_object = format == b'O'
8981  * if allocate_buffer:
8982  */
8983  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8984 
8985  /* "View.MemoryView":170
8986  *
8987  * self.free_data = allocate_buffer
8988  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
8989  * if allocate_buffer:
8990  *
8991  */
8992  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
8993  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
8994  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8995  __pyx_v_self->dtype_is_object = __pyx_t_4;
8996 
8997  /* "View.MemoryView":171
8998  * self.free_data = allocate_buffer
8999  * self.dtype_is_object = format == b'O'
9000  * if allocate_buffer: # <<<<<<<<<<<<<<
9001  *
9002  *
9003  */
9004  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
9005  if (__pyx_t_4) {
9006 
9007  /* "View.MemoryView":174
9008  *
9009  *
9010  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
9011  * if not self.data:
9012  * raise MemoryError("unable to allocate array data.")
9013  */
9014  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
9015 
9016  /* "View.MemoryView":175
9017  *
9018  * self.data = <char *>malloc(self.len)
9019  * if not self.data: # <<<<<<<<<<<<<<
9020  * raise MemoryError("unable to allocate array data.")
9021  *
9022  */
9023  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
9024  if (unlikely(__pyx_t_4)) {
9025 
9026  /* "View.MemoryView":176
9027  * self.data = <char *>malloc(self.len)
9028  * if not self.data:
9029  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
9030  *
9031  * if self.dtype_is_object:
9032  */
9033  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
9034  __Pyx_GOTREF(__pyx_t_10);
9035  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9036  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9037  __PYX_ERR(1, 176, __pyx_L1_error)
9038 
9039  /* "View.MemoryView":175
9040  *
9041  * self.data = <char *>malloc(self.len)
9042  * if not self.data: # <<<<<<<<<<<<<<
9043  * raise MemoryError("unable to allocate array data.")
9044  *
9045  */
9046  }
9047 
9048  /* "View.MemoryView":178
9049  * raise MemoryError("unable to allocate array data.")
9050  *
9051  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9052  * p = <PyObject **> self.data
9053  * for i in range(self.len / itemsize):
9054  */
9055  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
9056  if (__pyx_t_4) {
9057 
9058  /* "View.MemoryView":179
9059  *
9060  * if self.dtype_is_object:
9061  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
9062  * for i in range(self.len / itemsize):
9063  * p[i] = Py_None
9064  */
9065  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
9066 
9067  /* "View.MemoryView":180
9068  * if self.dtype_is_object:
9069  * p = <PyObject **> self.data
9070  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
9071  * p[i] = Py_None
9072  * Py_INCREF(Py_None)
9073  */
9074  if (unlikely(__pyx_v_itemsize == 0)) {
9075  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
9076  __PYX_ERR(1, 180, __pyx_L1_error)
9077  }
9078  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
9079  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
9080  __PYX_ERR(1, 180, __pyx_L1_error)
9081  }
9082  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
9083  __pyx_t_9 = __pyx_t_1;
9084  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
9085  __pyx_v_i = __pyx_t_11;
9086 
9087  /* "View.MemoryView":181
9088  * p = <PyObject **> self.data
9089  * for i in range(self.len / itemsize):
9090  * p[i] = Py_None # <<<<<<<<<<<<<<
9091  * Py_INCREF(Py_None)
9092  *
9093  */
9094  (__pyx_v_p[__pyx_v_i]) = Py_None;
9095 
9096  /* "View.MemoryView":182
9097  * for i in range(self.len / itemsize):
9098  * p[i] = Py_None
9099  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
9100  *
9101  * @cname('getbuffer')
9102  */
9103  Py_INCREF(Py_None);
9104  }
9105 
9106  /* "View.MemoryView":178
9107  * raise MemoryError("unable to allocate array data.")
9108  *
9109  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9110  * p = <PyObject **> self.data
9111  * for i in range(self.len / itemsize):
9112  */
9113  }
9114 
9115  /* "View.MemoryView":171
9116  * self.free_data = allocate_buffer
9117  * self.dtype_is_object = format == b'O'
9118  * if allocate_buffer: # <<<<<<<<<<<<<<
9119  *
9120  *
9121  */
9122  }
9123 
9124  /* "View.MemoryView":122
9125  * cdef bint dtype_is_object
9126  *
9127  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
9128  * mode="c", bint allocate_buffer=True):
9129  *
9130  */
9131 
9132  /* function exit code */
9133  __pyx_r = 0;
9134  goto __pyx_L0;
9135  __pyx_L1_error:;
9136  __Pyx_XDECREF(__pyx_t_3);
9137  __Pyx_XDECREF(__pyx_t_5);
9138  __Pyx_XDECREF(__pyx_t_6);
9139  __Pyx_XDECREF(__pyx_t_10);
9140  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9141  __pyx_r = -1;
9142  __pyx_L0:;
9143  __Pyx_XDECREF(__pyx_v_format);
9144  __Pyx_RefNannyFinishContext();
9145  return __pyx_r;
9146 }
9147 
9148 /* "View.MemoryView":185
9149  *
9150  * @cname('getbuffer')
9151  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9152  * cdef int bufmode = -1
9153  * if self.mode == u"c":
9154  */
9155 
9156 /* Python wrapper */
9157 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
9158 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9159  int __pyx_r;
9160  __Pyx_RefNannyDeclarations
9161  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
9162  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
9163 
9164  /* function exit code */
9165  __Pyx_RefNannyFinishContext();
9166  return __pyx_r;
9167 }
9168 
9169 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9170  int __pyx_v_bufmode;
9171  int __pyx_r;
9172  __Pyx_RefNannyDeclarations
9173  int __pyx_t_1;
9174  int __pyx_t_2;
9175  PyObject *__pyx_t_3 = NULL;
9176  char *__pyx_t_4;
9177  Py_ssize_t __pyx_t_5;
9178  int __pyx_t_6;
9179  Py_ssize_t *__pyx_t_7;
9180  if (__pyx_v_info == NULL) {
9181  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
9182  return -1;
9183  }
9184  __Pyx_RefNannySetupContext("__getbuffer__", 0);
9185  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9186  __Pyx_GIVEREF(__pyx_v_info->obj);
9187 
9188  /* "View.MemoryView":186
9189  * @cname('getbuffer')
9190  * def __getbuffer__(self, Py_buffer *info, int flags):
9191  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
9192  * if self.mode == u"c":
9193  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9194  */
9195  __pyx_v_bufmode = -1;
9196 
9197  /* "View.MemoryView":187
9198  * def __getbuffer__(self, Py_buffer *info, int flags):
9199  * cdef int bufmode = -1
9200  * if self.mode == u"c": # <<<<<<<<<<<<<<
9201  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9202  * elif self.mode == u"fortran":
9203  */
9204  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
9205  __pyx_t_2 = (__pyx_t_1 != 0);
9206  if (__pyx_t_2) {
9207 
9208  /* "View.MemoryView":188
9209  * cdef int bufmode = -1
9210  * if self.mode == u"c":
9211  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
9212  * elif self.mode == u"fortran":
9213  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9214  */
9215  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9216 
9217  /* "View.MemoryView":187
9218  * def __getbuffer__(self, Py_buffer *info, int flags):
9219  * cdef int bufmode = -1
9220  * if self.mode == u"c": # <<<<<<<<<<<<<<
9221  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9222  * elif self.mode == u"fortran":
9223  */
9224  goto __pyx_L3;
9225  }
9226 
9227  /* "View.MemoryView":189
9228  * if self.mode == u"c":
9229  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9230  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9231  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9232  * if not (flags & bufmode):
9233  */
9234  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
9235  __pyx_t_1 = (__pyx_t_2 != 0);
9236  if (__pyx_t_1) {
9237 
9238  /* "View.MemoryView":190
9239  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9240  * elif self.mode == u"fortran":
9241  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
9242  * if not (flags & bufmode):
9243  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9244  */
9245  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9246 
9247  /* "View.MemoryView":189
9248  * if self.mode == u"c":
9249  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9250  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9251  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9252  * if not (flags & bufmode):
9253  */
9254  }
9255  __pyx_L3:;
9256 
9257  /* "View.MemoryView":191
9258  * elif self.mode == u"fortran":
9259  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9260  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9261  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9262  * info.buf = self.data
9263  */
9264  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
9265  if (unlikely(__pyx_t_1)) {
9266 
9267  /* "View.MemoryView":192
9268  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9269  * if not (flags & bufmode):
9270  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
9271  * info.buf = self.data
9272  * info.len = self.len
9273  */
9274  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
9275  __Pyx_GOTREF(__pyx_t_3);
9276  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9277  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9278  __PYX_ERR(1, 192, __pyx_L1_error)
9279 
9280  /* "View.MemoryView":191
9281  * elif self.mode == u"fortran":
9282  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9283  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9284  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9285  * info.buf = self.data
9286  */
9287  }
9288 
9289  /* "View.MemoryView":193
9290  * if not (flags & bufmode):
9291  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9292  * info.buf = self.data # <<<<<<<<<<<<<<
9293  * info.len = self.len
9294  * info.ndim = self.ndim
9295  */
9296  __pyx_t_4 = __pyx_v_self->data;
9297  __pyx_v_info->buf = __pyx_t_4;
9298 
9299  /* "View.MemoryView":194
9300  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9301  * info.buf = self.data
9302  * info.len = self.len # <<<<<<<<<<<<<<
9303  * info.ndim = self.ndim
9304  * info.shape = self._shape
9305  */
9306  __pyx_t_5 = __pyx_v_self->len;
9307  __pyx_v_info->len = __pyx_t_5;
9308 
9309  /* "View.MemoryView":195
9310  * info.buf = self.data
9311  * info.len = self.len
9312  * info.ndim = self.ndim # <<<<<<<<<<<<<<
9313  * info.shape = self._shape
9314  * info.strides = self._strides
9315  */
9316  __pyx_t_6 = __pyx_v_self->ndim;
9317  __pyx_v_info->ndim = __pyx_t_6;
9318 
9319  /* "View.MemoryView":196
9320  * info.len = self.len
9321  * info.ndim = self.ndim
9322  * info.shape = self._shape # <<<<<<<<<<<<<<
9323  * info.strides = self._strides
9324  * info.suboffsets = NULL
9325  */
9326  __pyx_t_7 = __pyx_v_self->_shape;
9327  __pyx_v_info->shape = __pyx_t_7;
9328 
9329  /* "View.MemoryView":197
9330  * info.ndim = self.ndim
9331  * info.shape = self._shape
9332  * info.strides = self._strides # <<<<<<<<<<<<<<
9333  * info.suboffsets = NULL
9334  * info.itemsize = self.itemsize
9335  */
9336  __pyx_t_7 = __pyx_v_self->_strides;
9337  __pyx_v_info->strides = __pyx_t_7;
9338 
9339  /* "View.MemoryView":198
9340  * info.shape = self._shape
9341  * info.strides = self._strides
9342  * info.suboffsets = NULL # <<<<<<<<<<<<<<
9343  * info.itemsize = self.itemsize
9344  * info.readonly = 0
9345  */
9346  __pyx_v_info->suboffsets = NULL;
9347 
9348  /* "View.MemoryView":199
9349  * info.strides = self._strides
9350  * info.suboffsets = NULL
9351  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
9352  * info.readonly = 0
9353  *
9354  */
9355  __pyx_t_5 = __pyx_v_self->itemsize;
9356  __pyx_v_info->itemsize = __pyx_t_5;
9357 
9358  /* "View.MemoryView":200
9359  * info.suboffsets = NULL
9360  * info.itemsize = self.itemsize
9361  * info.readonly = 0 # <<<<<<<<<<<<<<
9362  *
9363  * if flags & PyBUF_FORMAT:
9364  */
9365  __pyx_v_info->readonly = 0;
9366 
9367  /* "View.MemoryView":202
9368  * info.readonly = 0
9369  *
9370  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9371  * info.format = self.format
9372  * else:
9373  */
9374  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9375  if (__pyx_t_1) {
9376 
9377  /* "View.MemoryView":203
9378  *
9379  * if flags & PyBUF_FORMAT:
9380  * info.format = self.format # <<<<<<<<<<<<<<
9381  * else:
9382  * info.format = NULL
9383  */
9384  __pyx_t_4 = __pyx_v_self->format;
9385  __pyx_v_info->format = __pyx_t_4;
9386 
9387  /* "View.MemoryView":202
9388  * info.readonly = 0
9389  *
9390  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9391  * info.format = self.format
9392  * else:
9393  */
9394  goto __pyx_L5;
9395  }
9396 
9397  /* "View.MemoryView":205
9398  * info.format = self.format
9399  * else:
9400  * info.format = NULL # <<<<<<<<<<<<<<
9401  *
9402  * info.obj = self
9403  */
9404  /*else*/ {
9405  __pyx_v_info->format = NULL;
9406  }
9407  __pyx_L5:;
9408 
9409  /* "View.MemoryView":207
9410  * info.format = NULL
9411  *
9412  * info.obj = self # <<<<<<<<<<<<<<
9413  *
9414  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9415  */
9416  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9417  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9418  __Pyx_GOTREF(__pyx_v_info->obj);
9419  __Pyx_DECREF(__pyx_v_info->obj);
9420  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9421 
9422  /* "View.MemoryView":185
9423  *
9424  * @cname('getbuffer')
9425  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9426  * cdef int bufmode = -1
9427  * if self.mode == u"c":
9428  */
9429 
9430  /* function exit code */
9431  __pyx_r = 0;
9432  goto __pyx_L0;
9433  __pyx_L1_error:;
9434  __Pyx_XDECREF(__pyx_t_3);
9435  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9436  __pyx_r = -1;
9437  if (__pyx_v_info->obj != NULL) {
9438  __Pyx_GOTREF(__pyx_v_info->obj);
9439  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9440  }
9441  goto __pyx_L2;
9442  __pyx_L0:;
9443  if (__pyx_v_info->obj == Py_None) {
9444  __Pyx_GOTREF(__pyx_v_info->obj);
9445  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9446  }
9447  __pyx_L2:;
9448  __Pyx_RefNannyFinishContext();
9449  return __pyx_r;
9450 }
9451 
9452 /* "View.MemoryView":211
9453  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9454  *
9455  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9456  * if self.callback_free_data != NULL:
9457  * self.callback_free_data(self.data)
9458  */
9459 
9460 /* Python wrapper */
9461 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
9462 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
9463  __Pyx_RefNannyDeclarations
9464  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
9465  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
9466 
9467  /* function exit code */
9468  __Pyx_RefNannyFinishContext();
9469 }
9470 
9471 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
9472  __Pyx_RefNannyDeclarations
9473  int __pyx_t_1;
9474  __Pyx_RefNannySetupContext("__dealloc__", 0);
9475 
9476  /* "View.MemoryView":212
9477  *
9478  * def __dealloc__(array self):
9479  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9480  * self.callback_free_data(self.data)
9481  * elif self.free_data:
9482  */
9483  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
9484  if (__pyx_t_1) {
9485 
9486  /* "View.MemoryView":213
9487  * def __dealloc__(array self):
9488  * if self.callback_free_data != NULL:
9489  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
9490  * elif self.free_data:
9491  * if self.dtype_is_object:
9492  */
9493  __pyx_v_self->callback_free_data(__pyx_v_self->data);
9494 
9495  /* "View.MemoryView":212
9496  *
9497  * def __dealloc__(array self):
9498  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9499  * self.callback_free_data(self.data)
9500  * elif self.free_data:
9501  */
9502  goto __pyx_L3;
9503  }
9504 
9505  /* "View.MemoryView":214
9506  * if self.callback_free_data != NULL:
9507  * self.callback_free_data(self.data)
9508  * elif self.free_data: # <<<<<<<<<<<<<<
9509  * if self.dtype_is_object:
9510  * refcount_objects_in_slice(self.data, self._shape,
9511  */
9512  __pyx_t_1 = (__pyx_v_self->free_data != 0);
9513  if (__pyx_t_1) {
9514 
9515  /* "View.MemoryView":215
9516  * self.callback_free_data(self.data)
9517  * elif self.free_data:
9518  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9519  * refcount_objects_in_slice(self.data, self._shape,
9520  * self._strides, self.ndim, False)
9521  */
9522  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
9523  if (__pyx_t_1) {
9524 
9525  /* "View.MemoryView":216
9526  * elif self.free_data:
9527  * if self.dtype_is_object:
9528  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
9529  * self._strides, self.ndim, False)
9530  * free(self.data)
9531  */
9532  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
9533 
9534  /* "View.MemoryView":215
9535  * self.callback_free_data(self.data)
9536  * elif self.free_data:
9537  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9538  * refcount_objects_in_slice(self.data, self._shape,
9539  * self._strides, self.ndim, False)
9540  */
9541  }
9542 
9543  /* "View.MemoryView":218
9544  * refcount_objects_in_slice(self.data, self._shape,
9545  * self._strides, self.ndim, False)
9546  * free(self.data) # <<<<<<<<<<<<<<
9547  * PyObject_Free(self._shape)
9548  *
9549  */
9550  free(__pyx_v_self->data);
9551 
9552  /* "View.MemoryView":214
9553  * if self.callback_free_data != NULL:
9554  * self.callback_free_data(self.data)
9555  * elif self.free_data: # <<<<<<<<<<<<<<
9556  * if self.dtype_is_object:
9557  * refcount_objects_in_slice(self.data, self._shape,
9558  */
9559  }
9560  __pyx_L3:;
9561 
9562  /* "View.MemoryView":219
9563  * self._strides, self.ndim, False)
9564  * free(self.data)
9565  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
9566  *
9567  * @property
9568  */
9569  PyObject_Free(__pyx_v_self->_shape);
9570 
9571  /* "View.MemoryView":211
9572  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9573  *
9574  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9575  * if self.callback_free_data != NULL:
9576  * self.callback_free_data(self.data)
9577  */
9578 
9579  /* function exit code */
9580  __Pyx_RefNannyFinishContext();
9581 }
9582 
9583 /* "View.MemoryView":222
9584  *
9585  * @property
9586  * def memview(self): # <<<<<<<<<<<<<<
9587  * return self.get_memview()
9588  *
9589  */
9590 
9591 /* Python wrapper */
9592 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
9593 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
9594  PyObject *__pyx_r = 0;
9595  __Pyx_RefNannyDeclarations
9596  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9597  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
9598 
9599  /* function exit code */
9600  __Pyx_RefNannyFinishContext();
9601  return __pyx_r;
9602 }
9603 
9604 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
9605  PyObject *__pyx_r = NULL;
9606  __Pyx_RefNannyDeclarations
9607  PyObject *__pyx_t_1 = NULL;
9608  __Pyx_RefNannySetupContext("__get__", 0);
9609 
9610  /* "View.MemoryView":223
9611  * @property
9612  * def memview(self):
9613  * return self.get_memview() # <<<<<<<<<<<<<<
9614  *
9615  * @cname('get_memview')
9616  */
9617  __Pyx_XDECREF(__pyx_r);
9618  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
9619  __Pyx_GOTREF(__pyx_t_1);
9620  __pyx_r = __pyx_t_1;
9621  __pyx_t_1 = 0;
9622  goto __pyx_L0;
9623 
9624  /* "View.MemoryView":222
9625  *
9626  * @property
9627  * def memview(self): # <<<<<<<<<<<<<<
9628  * return self.get_memview()
9629  *
9630  */
9631 
9632  /* function exit code */
9633  __pyx_L1_error:;
9634  __Pyx_XDECREF(__pyx_t_1);
9635  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9636  __pyx_r = NULL;
9637  __pyx_L0:;
9638  __Pyx_XGIVEREF(__pyx_r);
9639  __Pyx_RefNannyFinishContext();
9640  return __pyx_r;
9641 }
9642 
9643 /* "View.MemoryView":226
9644  *
9645  * @cname('get_memview')
9646  * cdef get_memview(self): # <<<<<<<<<<<<<<
9647  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9648  * return memoryview(self, flags, self.dtype_is_object)
9649  */
9650 
9651 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
9652  int __pyx_v_flags;
9653  PyObject *__pyx_r = NULL;
9654  __Pyx_RefNannyDeclarations
9655  PyObject *__pyx_t_1 = NULL;
9656  PyObject *__pyx_t_2 = NULL;
9657  PyObject *__pyx_t_3 = NULL;
9658  __Pyx_RefNannySetupContext("get_memview", 0);
9659 
9660  /* "View.MemoryView":227
9661  * @cname('get_memview')
9662  * cdef get_memview(self):
9663  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
9664  * return memoryview(self, flags, self.dtype_is_object)
9665  *
9666  */
9667  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9668 
9669  /* "View.MemoryView":228
9670  * cdef get_memview(self):
9671  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9672  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
9673  *
9674  * def __len__(self):
9675  */
9676  __Pyx_XDECREF(__pyx_r);
9677  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
9678  __Pyx_GOTREF(__pyx_t_1);
9679  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
9680  __Pyx_GOTREF(__pyx_t_2);
9681  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
9682  __Pyx_GOTREF(__pyx_t_3);
9683  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9684  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9685  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9686  __Pyx_GIVEREF(__pyx_t_1);
9687  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9688  __Pyx_GIVEREF(__pyx_t_2);
9689  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9690  __pyx_t_1 = 0;
9691  __pyx_t_2 = 0;
9692  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
9693  __Pyx_GOTREF(__pyx_t_2);
9694  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9695  __pyx_r = __pyx_t_2;
9696  __pyx_t_2 = 0;
9697  goto __pyx_L0;
9698 
9699  /* "View.MemoryView":226
9700  *
9701  * @cname('get_memview')
9702  * cdef get_memview(self): # <<<<<<<<<<<<<<
9703  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9704  * return memoryview(self, flags, self.dtype_is_object)
9705  */
9706 
9707  /* function exit code */
9708  __pyx_L1_error:;
9709  __Pyx_XDECREF(__pyx_t_1);
9710  __Pyx_XDECREF(__pyx_t_2);
9711  __Pyx_XDECREF(__pyx_t_3);
9712  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9713  __pyx_r = 0;
9714  __pyx_L0:;
9715  __Pyx_XGIVEREF(__pyx_r);
9716  __Pyx_RefNannyFinishContext();
9717  return __pyx_r;
9718 }
9719 
9720 /* "View.MemoryView":230
9721  * return memoryview(self, flags, self.dtype_is_object)
9722  *
9723  * def __len__(self): # <<<<<<<<<<<<<<
9724  * return self._shape[0]
9725  *
9726  */
9727 
9728 /* Python wrapper */
9729 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
9730 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9731  Py_ssize_t __pyx_r;
9732  __Pyx_RefNannyDeclarations
9733  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
9734  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
9735 
9736  /* function exit code */
9737  __Pyx_RefNannyFinishContext();
9738  return __pyx_r;
9739 }
9740 
9741 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
9742  Py_ssize_t __pyx_r;
9743  __Pyx_RefNannyDeclarations
9744  __Pyx_RefNannySetupContext("__len__", 0);
9745 
9746  /* "View.MemoryView":231
9747  *
9748  * def __len__(self):
9749  * return self._shape[0] # <<<<<<<<<<<<<<
9750  *
9751  * def __getattr__(self, attr):
9752  */
9753  __pyx_r = (__pyx_v_self->_shape[0]);
9754  goto __pyx_L0;
9755 
9756  /* "View.MemoryView":230
9757  * return memoryview(self, flags, self.dtype_is_object)
9758  *
9759  * def __len__(self): # <<<<<<<<<<<<<<
9760  * return self._shape[0]
9761  *
9762  */
9763 
9764  /* function exit code */
9765  __pyx_L0:;
9766  __Pyx_RefNannyFinishContext();
9767  return __pyx_r;
9768 }
9769 
9770 /* "View.MemoryView":233
9771  * return self._shape[0]
9772  *
9773  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9774  * return getattr(self.memview, attr)
9775  *
9776  */
9777 
9778 /* Python wrapper */
9779 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
9780 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9781  PyObject *__pyx_r = 0;
9782  __Pyx_RefNannyDeclarations
9783  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
9784  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9785 
9786  /* function exit code */
9787  __Pyx_RefNannyFinishContext();
9788  return __pyx_r;
9789 }
9790 
9791 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9792  PyObject *__pyx_r = NULL;
9793  __Pyx_RefNannyDeclarations
9794  PyObject *__pyx_t_1 = NULL;
9795  PyObject *__pyx_t_2 = NULL;
9796  __Pyx_RefNannySetupContext("__getattr__", 0);
9797 
9798  /* "View.MemoryView":234
9799  *
9800  * def __getattr__(self, attr):
9801  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
9802  *
9803  * def __getitem__(self, item):
9804  */
9805  __Pyx_XDECREF(__pyx_r);
9806  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
9807  __Pyx_GOTREF(__pyx_t_1);
9808  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
9809  __Pyx_GOTREF(__pyx_t_2);
9810  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9811  __pyx_r = __pyx_t_2;
9812  __pyx_t_2 = 0;
9813  goto __pyx_L0;
9814 
9815  /* "View.MemoryView":233
9816  * return self._shape[0]
9817  *
9818  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9819  * return getattr(self.memview, attr)
9820  *
9821  */
9822 
9823  /* function exit code */
9824  __pyx_L1_error:;
9825  __Pyx_XDECREF(__pyx_t_1);
9826  __Pyx_XDECREF(__pyx_t_2);
9827  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9828  __pyx_r = NULL;
9829  __pyx_L0:;
9830  __Pyx_XGIVEREF(__pyx_r);
9831  __Pyx_RefNannyFinishContext();
9832  return __pyx_r;
9833 }
9834 
9835 /* "View.MemoryView":236
9836  * return getattr(self.memview, attr)
9837  *
9838  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9839  * return self.memview[item]
9840  *
9841  */
9842 
9843 /* Python wrapper */
9844 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
9845 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9846  PyObject *__pyx_r = 0;
9847  __Pyx_RefNannyDeclarations
9848  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9849  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9850 
9851  /* function exit code */
9852  __Pyx_RefNannyFinishContext();
9853  return __pyx_r;
9854 }
9855 
9856 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9857  PyObject *__pyx_r = NULL;
9858  __Pyx_RefNannyDeclarations
9859  PyObject *__pyx_t_1 = NULL;
9860  PyObject *__pyx_t_2 = NULL;
9861  __Pyx_RefNannySetupContext("__getitem__", 0);
9862 
9863  /* "View.MemoryView":237
9864  *
9865  * def __getitem__(self, item):
9866  * return self.memview[item] # <<<<<<<<<<<<<<
9867  *
9868  * def __setitem__(self, item, value):
9869  */
9870  __Pyx_XDECREF(__pyx_r);
9871  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
9872  __Pyx_GOTREF(__pyx_t_1);
9873  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
9874  __Pyx_GOTREF(__pyx_t_2);
9875  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9876  __pyx_r = __pyx_t_2;
9877  __pyx_t_2 = 0;
9878  goto __pyx_L0;
9879 
9880  /* "View.MemoryView":236
9881  * return getattr(self.memview, attr)
9882  *
9883  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9884  * return self.memview[item]
9885  *
9886  */
9887 
9888  /* function exit code */
9889  __pyx_L1_error:;
9890  __Pyx_XDECREF(__pyx_t_1);
9891  __Pyx_XDECREF(__pyx_t_2);
9892  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9893  __pyx_r = NULL;
9894  __pyx_L0:;
9895  __Pyx_XGIVEREF(__pyx_r);
9896  __Pyx_RefNannyFinishContext();
9897  return __pyx_r;
9898 }
9899 
9900 /* "View.MemoryView":239
9901  * return self.memview[item]
9902  *
9903  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9904  * self.memview[item] = value
9905  *
9906  */
9907 
9908 /* Python wrapper */
9909 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
9910 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9911  int __pyx_r;
9912  __Pyx_RefNannyDeclarations
9913  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9914  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
9915 
9916  /* function exit code */
9917  __Pyx_RefNannyFinishContext();
9918  return __pyx_r;
9919 }
9920 
9921 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9922  int __pyx_r;
9923  __Pyx_RefNannyDeclarations
9924  PyObject *__pyx_t_1 = NULL;
9925  __Pyx_RefNannySetupContext("__setitem__", 0);
9926 
9927  /* "View.MemoryView":240
9928  *
9929  * def __setitem__(self, item, value):
9930  * self.memview[item] = value # <<<<<<<<<<<<<<
9931  *
9932  *
9933  */
9934  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
9935  __Pyx_GOTREF(__pyx_t_1);
9936  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
9937  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9938 
9939  /* "View.MemoryView":239
9940  * return self.memview[item]
9941  *
9942  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9943  * self.memview[item] = value
9944  *
9945  */
9946 
9947  /* function exit code */
9948  __pyx_r = 0;
9949  goto __pyx_L0;
9950  __pyx_L1_error:;
9951  __Pyx_XDECREF(__pyx_t_1);
9952  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9953  __pyx_r = -1;
9954  __pyx_L0:;
9955  __Pyx_RefNannyFinishContext();
9956  return __pyx_r;
9957 }
9958 
9959 /* "(tree fragment)":1
9960  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9961  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9962  * def __setstate_cython__(self, __pyx_state):
9963  */
9964 
9965 /* Python wrapper */
9966 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9967 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9968  PyObject *__pyx_r = 0;
9969  __Pyx_RefNannyDeclarations
9970  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9971  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
9972 
9973  /* function exit code */
9974  __Pyx_RefNannyFinishContext();
9975  return __pyx_r;
9976 }
9977 
9978 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
9979  PyObject *__pyx_r = NULL;
9980  __Pyx_RefNannyDeclarations
9981  PyObject *__pyx_t_1 = NULL;
9982  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9983 
9984  /* "(tree fragment)":2
9985  * def __reduce_cython__(self):
9986  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9987  * def __setstate_cython__(self, __pyx_state):
9988  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9989  */
9990  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9991  __Pyx_GOTREF(__pyx_t_1);
9992  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9993  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9994  __PYX_ERR(1, 2, __pyx_L1_error)
9995 
9996  /* "(tree fragment)":1
9997  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9998  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9999  * def __setstate_cython__(self, __pyx_state):
10000  */
10001 
10002  /* function exit code */
10003  __pyx_L1_error:;
10004  __Pyx_XDECREF(__pyx_t_1);
10005  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10006  __pyx_r = NULL;
10007  __Pyx_XGIVEREF(__pyx_r);
10008  __Pyx_RefNannyFinishContext();
10009  return __pyx_r;
10010 }
10011 
10012 /* "(tree fragment)":3
10013  * def __reduce_cython__(self):
10014  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10015  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10016  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10017  */
10018 
10019 /* Python wrapper */
10020 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10021 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10022  PyObject *__pyx_r = 0;
10023  __Pyx_RefNannyDeclarations
10024  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10025  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10026 
10027  /* function exit code */
10028  __Pyx_RefNannyFinishContext();
10029  return __pyx_r;
10030 }
10031 
10032 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
10033  PyObject *__pyx_r = NULL;
10034  __Pyx_RefNannyDeclarations
10035  PyObject *__pyx_t_1 = NULL;
10036  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10037 
10038  /* "(tree fragment)":4
10039  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10040  * def __setstate_cython__(self, __pyx_state):
10041  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10042  */
10043  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
10044  __Pyx_GOTREF(__pyx_t_1);
10045  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10046  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10047  __PYX_ERR(1, 4, __pyx_L1_error)
10048 
10049  /* "(tree fragment)":3
10050  * def __reduce_cython__(self):
10051  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10052  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10053  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10054  */
10055 
10056  /* function exit code */
10057  __pyx_L1_error:;
10058  __Pyx_XDECREF(__pyx_t_1);
10059  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10060  __pyx_r = NULL;
10061  __Pyx_XGIVEREF(__pyx_r);
10062  __Pyx_RefNannyFinishContext();
10063  return __pyx_r;
10064 }
10065 
10066 /* "View.MemoryView":244
10067  *
10068  * @cname("__pyx_array_new")
10069  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
10070  * char *mode, char *buf):
10071  * cdef array result
10072  */
10073 
10074 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
10075  struct __pyx_array_obj *__pyx_v_result = 0;
10076  struct __pyx_array_obj *__pyx_r = NULL;
10077  __Pyx_RefNannyDeclarations
10078  int __pyx_t_1;
10079  PyObject *__pyx_t_2 = NULL;
10080  PyObject *__pyx_t_3 = NULL;
10081  PyObject *__pyx_t_4 = NULL;
10082  PyObject *__pyx_t_5 = NULL;
10083  __Pyx_RefNannySetupContext("array_cwrapper", 0);
10084 
10085  /* "View.MemoryView":248
10086  * cdef array result
10087  *
10088  * if buf == NULL: # <<<<<<<<<<<<<<
10089  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10090  * else:
10091  */
10092  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
10093  if (__pyx_t_1) {
10094 
10095  /* "View.MemoryView":249
10096  *
10097  * if buf == NULL:
10098  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
10099  * else:
10100  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10101  */
10102  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
10103  __Pyx_GOTREF(__pyx_t_2);
10104  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
10105  __Pyx_GOTREF(__pyx_t_3);
10106  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
10107  __Pyx_GOTREF(__pyx_t_4);
10108  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
10109  __Pyx_GOTREF(__pyx_t_5);
10110  __Pyx_INCREF(__pyx_v_shape);
10111  __Pyx_GIVEREF(__pyx_v_shape);
10112  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
10113  __Pyx_GIVEREF(__pyx_t_2);
10114  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
10115  __Pyx_GIVEREF(__pyx_t_3);
10116  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
10117  __Pyx_GIVEREF(__pyx_t_4);
10118  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
10119  __pyx_t_2 = 0;
10120  __pyx_t_3 = 0;
10121  __pyx_t_4 = 0;
10122  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
10123  __Pyx_GOTREF(__pyx_t_4);
10124  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10125  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
10126  __pyx_t_4 = 0;
10127 
10128  /* "View.MemoryView":248
10129  * cdef array result
10130  *
10131  * if buf == NULL: # <<<<<<<<<<<<<<
10132  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10133  * else:
10134  */
10135  goto __pyx_L3;
10136  }
10137 
10138  /* "View.MemoryView":251
10139  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10140  * else:
10141  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10142  * allocate_buffer=False)
10143  * result.data = buf
10144  */
10145  /*else*/ {
10146  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
10147  __Pyx_GOTREF(__pyx_t_4);
10148  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
10149  __Pyx_GOTREF(__pyx_t_5);
10150  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
10151  __Pyx_GOTREF(__pyx_t_3);
10152  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
10153  __Pyx_GOTREF(__pyx_t_2);
10154  __Pyx_INCREF(__pyx_v_shape);
10155  __Pyx_GIVEREF(__pyx_v_shape);
10156  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
10157  __Pyx_GIVEREF(__pyx_t_4);
10158  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
10159  __Pyx_GIVEREF(__pyx_t_5);
10160  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
10161  __Pyx_GIVEREF(__pyx_t_3);
10162  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
10163  __pyx_t_4 = 0;
10164  __pyx_t_5 = 0;
10165  __pyx_t_3 = 0;
10166 
10167  /* "View.MemoryView":252
10168  * else:
10169  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10170  * allocate_buffer=False) # <<<<<<<<<<<<<<
10171  * result.data = buf
10172  *
10173  */
10174  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
10175  __Pyx_GOTREF(__pyx_t_3);
10176  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
10177 
10178  /* "View.MemoryView":251
10179  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10180  * else:
10181  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10182  * allocate_buffer=False)
10183  * result.data = buf
10184  */
10185  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
10186  __Pyx_GOTREF(__pyx_t_5);
10187  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10188  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10189  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
10190  __pyx_t_5 = 0;
10191 
10192  /* "View.MemoryView":253
10193  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10194  * allocate_buffer=False)
10195  * result.data = buf # <<<<<<<<<<<<<<
10196  *
10197  * return result
10198  */
10199  __pyx_v_result->data = __pyx_v_buf;
10200  }
10201  __pyx_L3:;
10202 
10203  /* "View.MemoryView":255
10204  * result.data = buf
10205  *
10206  * return result # <<<<<<<<<<<<<<
10207  *
10208  *
10209  */
10210  __Pyx_XDECREF(((PyObject *)__pyx_r));
10211  __Pyx_INCREF(((PyObject *)__pyx_v_result));
10212  __pyx_r = __pyx_v_result;
10213  goto __pyx_L0;
10214 
10215  /* "View.MemoryView":244
10216  *
10217  * @cname("__pyx_array_new")
10218  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
10219  * char *mode, char *buf):
10220  * cdef array result
10221  */
10222 
10223  /* function exit code */
10224  __pyx_L1_error:;
10225  __Pyx_XDECREF(__pyx_t_2);
10226  __Pyx_XDECREF(__pyx_t_3);
10227  __Pyx_XDECREF(__pyx_t_4);
10228  __Pyx_XDECREF(__pyx_t_5);
10229  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
10230  __pyx_r = 0;
10231  __pyx_L0:;
10232  __Pyx_XDECREF((PyObject *)__pyx_v_result);
10233  __Pyx_XGIVEREF((PyObject *)__pyx_r);
10234  __Pyx_RefNannyFinishContext();
10235  return __pyx_r;
10236 }
10237 
10238 /* "View.MemoryView":281
10239  * cdef class Enum(object):
10240  * cdef object name
10241  * def __init__(self, name): # <<<<<<<<<<<<<<
10242  * self.name = name
10243  * def __repr__(self):
10244  */
10245 
10246 /* Python wrapper */
10247 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10248 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10249  PyObject *__pyx_v_name = 0;
10250  int __pyx_r;
10251  __Pyx_RefNannyDeclarations
10252  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
10253  {
10254  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
10255  PyObject* values[1] = {0};
10256  if (unlikely(__pyx_kwds)) {
10257  Py_ssize_t kw_args;
10258  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10259  switch (pos_args) {
10260  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10261  CYTHON_FALLTHROUGH;
10262  case 0: break;
10263  default: goto __pyx_L5_argtuple_error;
10264  }
10265  kw_args = PyDict_Size(__pyx_kwds);
10266  switch (pos_args) {
10267  case 0:
10268  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
10269  else goto __pyx_L5_argtuple_error;
10270  }
10271  if (unlikely(kw_args > 0)) {
10272  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
10273  }
10274  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10275  goto __pyx_L5_argtuple_error;
10276  } else {
10277  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10278  }
10279  __pyx_v_name = values[0];
10280  }
10281  goto __pyx_L4_argument_unpacking_done;
10282  __pyx_L5_argtuple_error:;
10283  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
10284  __pyx_L3_error:;
10285  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10286  __Pyx_RefNannyFinishContext();
10287  return -1;
10288  __pyx_L4_argument_unpacking_done:;
10289  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
10290 
10291  /* function exit code */
10292  __Pyx_RefNannyFinishContext();
10293  return __pyx_r;
10294 }
10295 
10296 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
10297  int __pyx_r;
10298  __Pyx_RefNannyDeclarations
10299  __Pyx_RefNannySetupContext("__init__", 0);
10300 
10301  /* "View.MemoryView":282
10302  * cdef object name
10303  * def __init__(self, name):
10304  * self.name = name # <<<<<<<<<<<<<<
10305  * def __repr__(self):
10306  * return self.name
10307  */
10308  __Pyx_INCREF(__pyx_v_name);
10309  __Pyx_GIVEREF(__pyx_v_name);
10310  __Pyx_GOTREF(__pyx_v_self->name);
10311  __Pyx_DECREF(__pyx_v_self->name);
10312  __pyx_v_self->name = __pyx_v_name;
10313 
10314  /* "View.MemoryView":281
10315  * cdef class Enum(object):
10316  * cdef object name
10317  * def __init__(self, name): # <<<<<<<<<<<<<<
10318  * self.name = name
10319  * def __repr__(self):
10320  */
10321 
10322  /* function exit code */
10323  __pyx_r = 0;
10324  __Pyx_RefNannyFinishContext();
10325  return __pyx_r;
10326 }
10327 
10328 /* "View.MemoryView":283
10329  * def __init__(self, name):
10330  * self.name = name
10331  * def __repr__(self): # <<<<<<<<<<<<<<
10332  * return self.name
10333  *
10334  */
10335 
10336 /* Python wrapper */
10337 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
10338 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
10339  PyObject *__pyx_r = 0;
10340  __Pyx_RefNannyDeclarations
10341  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
10342  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10343 
10344  /* function exit code */
10345  __Pyx_RefNannyFinishContext();
10346  return __pyx_r;
10347 }
10348 
10349 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10350  PyObject *__pyx_r = NULL;
10351  __Pyx_RefNannyDeclarations
10352  __Pyx_RefNannySetupContext("__repr__", 0);
10353 
10354  /* "View.MemoryView":284
10355  * self.name = name
10356  * def __repr__(self):
10357  * return self.name # <<<<<<<<<<<<<<
10358  *
10359  * cdef generic = Enum("<strided and direct or indirect>")
10360  */
10361  __Pyx_XDECREF(__pyx_r);
10362  __Pyx_INCREF(__pyx_v_self->name);
10363  __pyx_r = __pyx_v_self->name;
10364  goto __pyx_L0;
10365 
10366  /* "View.MemoryView":283
10367  * def __init__(self, name):
10368  * self.name = name
10369  * def __repr__(self): # <<<<<<<<<<<<<<
10370  * return self.name
10371  *
10372  */
10373 
10374  /* function exit code */
10375  __pyx_L0:;
10376  __Pyx_XGIVEREF(__pyx_r);
10377  __Pyx_RefNannyFinishContext();
10378  return __pyx_r;
10379 }
10380 
10381 /* "(tree fragment)":1
10382  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10383  * cdef tuple state
10384  * cdef object _dict
10385  */
10386 
10387 /* Python wrapper */
10388 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10389 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10390  PyObject *__pyx_r = 0;
10391  __Pyx_RefNannyDeclarations
10392  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10393  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10394 
10395  /* function exit code */
10396  __Pyx_RefNannyFinishContext();
10397  return __pyx_r;
10398 }
10399 
10400 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10401  PyObject *__pyx_v_state = 0;
10402  PyObject *__pyx_v__dict = 0;
10403  int __pyx_v_use_setstate;
10404  PyObject *__pyx_r = NULL;
10405  __Pyx_RefNannyDeclarations
10406  PyObject *__pyx_t_1 = NULL;
10407  int __pyx_t_2;
10408  int __pyx_t_3;
10409  PyObject *__pyx_t_4 = NULL;
10410  PyObject *__pyx_t_5 = NULL;
10411  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10412 
10413  /* "(tree fragment)":5
10414  * cdef object _dict
10415  * cdef bint use_setstate
10416  * state = (self.name,) # <<<<<<<<<<<<<<
10417  * _dict = getattr(self, '__dict__', None)
10418  * if _dict is not None:
10419  */
10420  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
10421  __Pyx_GOTREF(__pyx_t_1);
10422  __Pyx_INCREF(__pyx_v_self->name);
10423  __Pyx_GIVEREF(__pyx_v_self->name);
10424  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
10425  __pyx_v_state = ((PyObject*)__pyx_t_1);
10426  __pyx_t_1 = 0;
10427 
10428  /* "(tree fragment)":6
10429  * cdef bint use_setstate
10430  * state = (self.name,)
10431  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
10432  * if _dict is not None:
10433  * state += (_dict,)
10434  */
10435  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
10436  __Pyx_GOTREF(__pyx_t_1);
10437  __pyx_v__dict = __pyx_t_1;
10438  __pyx_t_1 = 0;
10439 
10440  /* "(tree fragment)":7
10441  * state = (self.name,)
10442  * _dict = getattr(self, '__dict__', None)
10443  * if _dict is not None: # <<<<<<<<<<<<<<
10444  * state += (_dict,)
10445  * use_setstate = True
10446  */
10447  __pyx_t_2 = (__pyx_v__dict != Py_None);
10448  __pyx_t_3 = (__pyx_t_2 != 0);
10449  if (__pyx_t_3) {
10450 
10451  /* "(tree fragment)":8
10452  * _dict = getattr(self, '__dict__', None)
10453  * if _dict is not None:
10454  * state += (_dict,) # <<<<<<<<<<<<<<
10455  * use_setstate = True
10456  * else:
10457  */
10458  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
10459  __Pyx_GOTREF(__pyx_t_1);
10460  __Pyx_INCREF(__pyx_v__dict);
10461  __Pyx_GIVEREF(__pyx_v__dict);
10462  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
10463  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
10464  __Pyx_GOTREF(__pyx_t_4);
10465  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10466  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
10467  __pyx_t_4 = 0;
10468 
10469  /* "(tree fragment)":9
10470  * if _dict is not None:
10471  * state += (_dict,)
10472  * use_setstate = True # <<<<<<<<<<<<<<
10473  * else:
10474  * use_setstate = self.name is not None
10475  */
10476  __pyx_v_use_setstate = 1;
10477 
10478  /* "(tree fragment)":7
10479  * state = (self.name,)
10480  * _dict = getattr(self, '__dict__', None)
10481  * if _dict is not None: # <<<<<<<<<<<<<<
10482  * state += (_dict,)
10483  * use_setstate = True
10484  */
10485  goto __pyx_L3;
10486  }
10487 
10488  /* "(tree fragment)":11
10489  * use_setstate = True
10490  * else:
10491  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
10492  * if use_setstate:
10493  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10494  */
10495  /*else*/ {
10496  __pyx_t_3 = (__pyx_v_self->name != Py_None);
10497  __pyx_v_use_setstate = __pyx_t_3;
10498  }
10499  __pyx_L3:;
10500 
10501  /* "(tree fragment)":12
10502  * else:
10503  * use_setstate = self.name is not None
10504  * if use_setstate: # <<<<<<<<<<<<<<
10505  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10506  * else:
10507  */
10508  __pyx_t_3 = (__pyx_v_use_setstate != 0);
10509  if (__pyx_t_3) {
10510 
10511  /* "(tree fragment)":13
10512  * use_setstate = self.name is not None
10513  * if use_setstate:
10514  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
10515  * else:
10516  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10517  */
10518  __Pyx_XDECREF(__pyx_r);
10519  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
10520  __Pyx_GOTREF(__pyx_t_4);
10521  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
10522  __Pyx_GOTREF(__pyx_t_1);
10523  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10524  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10525  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10526  __Pyx_INCREF(__pyx_int_184977713);
10527  __Pyx_GIVEREF(__pyx_int_184977713);
10528  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10529  __Pyx_INCREF(Py_None);
10530  __Pyx_GIVEREF(Py_None);
10531  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
10532  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
10533  __Pyx_GOTREF(__pyx_t_5);
10534  __Pyx_GIVEREF(__pyx_t_4);
10535  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10536  __Pyx_GIVEREF(__pyx_t_1);
10537  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
10538  __Pyx_INCREF(__pyx_v_state);
10539  __Pyx_GIVEREF(__pyx_v_state);
10540  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
10541  __pyx_t_4 = 0;
10542  __pyx_t_1 = 0;
10543  __pyx_r = __pyx_t_5;
10544  __pyx_t_5 = 0;
10545  goto __pyx_L0;
10546 
10547  /* "(tree fragment)":12
10548  * else:
10549  * use_setstate = self.name is not None
10550  * if use_setstate: # <<<<<<<<<<<<<<
10551  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10552  * else:
10553  */
10554  }
10555 
10556  /* "(tree fragment)":15
10557  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10558  * else:
10559  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
10560  * def __setstate_cython__(self, __pyx_state):
10561  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10562  */
10563  /*else*/ {
10564  __Pyx_XDECREF(__pyx_r);
10565  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
10566  __Pyx_GOTREF(__pyx_t_5);
10567  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
10568  __Pyx_GOTREF(__pyx_t_1);
10569  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10570  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10571  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10572  __Pyx_INCREF(__pyx_int_184977713);
10573  __Pyx_GIVEREF(__pyx_int_184977713);
10574  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10575  __Pyx_INCREF(__pyx_v_state);
10576  __Pyx_GIVEREF(__pyx_v_state);
10577  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10578  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
10579  __Pyx_GOTREF(__pyx_t_4);
10580  __Pyx_GIVEREF(__pyx_t_5);
10581  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10582  __Pyx_GIVEREF(__pyx_t_1);
10583  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10584  __pyx_t_5 = 0;
10585  __pyx_t_1 = 0;
10586  __pyx_r = __pyx_t_4;
10587  __pyx_t_4 = 0;
10588  goto __pyx_L0;
10589  }
10590 
10591  /* "(tree fragment)":1
10592  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10593  * cdef tuple state
10594  * cdef object _dict
10595  */
10596 
10597  /* function exit code */
10598  __pyx_L1_error:;
10599  __Pyx_XDECREF(__pyx_t_1);
10600  __Pyx_XDECREF(__pyx_t_4);
10601  __Pyx_XDECREF(__pyx_t_5);
10602  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10603  __pyx_r = NULL;
10604  __pyx_L0:;
10605  __Pyx_XDECREF(__pyx_v_state);
10606  __Pyx_XDECREF(__pyx_v__dict);
10607  __Pyx_XGIVEREF(__pyx_r);
10608  __Pyx_RefNannyFinishContext();
10609  return __pyx_r;
10610 }
10611 
10612 /* "(tree fragment)":16
10613  * else:
10614  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10615  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10616  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10617  */
10618 
10619 /* Python wrapper */
10620 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10621 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10622  PyObject *__pyx_r = 0;
10623  __Pyx_RefNannyDeclarations
10624  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10625  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10626 
10627  /* function exit code */
10628  __Pyx_RefNannyFinishContext();
10629  return __pyx_r;
10630 }
10631 
10632 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10633  PyObject *__pyx_r = NULL;
10634  __Pyx_RefNannyDeclarations
10635  PyObject *__pyx_t_1 = NULL;
10636  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10637 
10638  /* "(tree fragment)":17
10639  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10640  * def __setstate_cython__(self, __pyx_state):
10641  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
10642  */
10643  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
10644  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
10645  __Pyx_GOTREF(__pyx_t_1);
10646  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10647 
10648  /* "(tree fragment)":16
10649  * else:
10650  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10651  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10652  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10653  */
10654 
10655  /* function exit code */
10656  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10657  goto __pyx_L0;
10658  __pyx_L1_error:;
10659  __Pyx_XDECREF(__pyx_t_1);
10660  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10661  __pyx_r = NULL;
10662  __pyx_L0:;
10663  __Pyx_XGIVEREF(__pyx_r);
10664  __Pyx_RefNannyFinishContext();
10665  return __pyx_r;
10666 }
10667 
10668 /* "View.MemoryView":298
10669  *
10670  * @cname('__pyx_align_pointer')
10671  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10672  * "Align pointer memory on a given boundary"
10673  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10674  */
10675 
10676 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
10677  Py_intptr_t __pyx_v_aligned_p;
10678  size_t __pyx_v_offset;
10679  void *__pyx_r;
10680  int __pyx_t_1;
10681 
10682  /* "View.MemoryView":300
10683  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
10684  * "Align pointer memory on a given boundary"
10685  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
10686  * cdef size_t offset
10687  *
10688  */
10689  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10690 
10691  /* "View.MemoryView":304
10692  *
10693  * with cython.cdivision(True):
10694  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
10695  *
10696  * if offset > 0:
10697  */
10698  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10699 
10700  /* "View.MemoryView":306
10701  * offset = aligned_p % alignment
10702  *
10703  * if offset > 0: # <<<<<<<<<<<<<<
10704  * aligned_p += alignment - offset
10705  *
10706  */
10707  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10708  if (__pyx_t_1) {
10709 
10710  /* "View.MemoryView":307
10711  *
10712  * if offset > 0:
10713  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
10714  *
10715  * return <void *> aligned_p
10716  */
10717  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10718 
10719  /* "View.MemoryView":306
10720  * offset = aligned_p % alignment
10721  *
10722  * if offset > 0: # <<<<<<<<<<<<<<
10723  * aligned_p += alignment - offset
10724  *
10725  */
10726  }
10727 
10728  /* "View.MemoryView":309
10729  * aligned_p += alignment - offset
10730  *
10731  * return <void *> aligned_p # <<<<<<<<<<<<<<
10732  *
10733  *
10734  */
10735  __pyx_r = ((void *)__pyx_v_aligned_p);
10736  goto __pyx_L0;
10737 
10738  /* "View.MemoryView":298
10739  *
10740  * @cname('__pyx_align_pointer')
10741  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10742  * "Align pointer memory on a given boundary"
10743  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10744  */
10745 
10746  /* function exit code */
10747  __pyx_L0:;
10748  return __pyx_r;
10749 }
10750 
10751 /* "View.MemoryView":345
10752  * cdef __Pyx_TypeInfo *typeinfo
10753  *
10754  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10755  * self.obj = obj
10756  * self.flags = flags
10757  */
10758 
10759 /* Python wrapper */
10760 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10761 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10762  PyObject *__pyx_v_obj = 0;
10763  int __pyx_v_flags;
10764  int __pyx_v_dtype_is_object;
10765  int __pyx_r;
10766  __Pyx_RefNannyDeclarations
10767  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
10768  {
10769  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10770  PyObject* values[3] = {0,0,0};
10771  if (unlikely(__pyx_kwds)) {
10772  Py_ssize_t kw_args;
10773  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10774  switch (pos_args) {
10775  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10776  CYTHON_FALLTHROUGH;
10777  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10778  CYTHON_FALLTHROUGH;
10779  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10780  CYTHON_FALLTHROUGH;
10781  case 0: break;
10782  default: goto __pyx_L5_argtuple_error;
10783  }
10784  kw_args = PyDict_Size(__pyx_kwds);
10785  switch (pos_args) {
10786  case 0:
10787  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10788  else goto __pyx_L5_argtuple_error;
10789  CYTHON_FALLTHROUGH;
10790  case 1:
10791  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10792  else {
10793  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
10794  }
10795  CYTHON_FALLTHROUGH;
10796  case 2:
10797  if (kw_args > 0) {
10798  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10799  if (value) { values[2] = value; kw_args--; }
10800  }
10801  }
10802  if (unlikely(kw_args > 0)) {
10803  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
10804  }
10805  } else {
10806  switch (PyTuple_GET_SIZE(__pyx_args)) {
10807  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10808  CYTHON_FALLTHROUGH;
10809  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10810  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10811  break;
10812  default: goto __pyx_L5_argtuple_error;
10813  }
10814  }
10815  __pyx_v_obj = values[0];
10816  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10817  if (values[2]) {
10818  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10819  } else {
10820  __pyx_v_dtype_is_object = ((int)0);
10821  }
10822  }
10823  goto __pyx_L4_argument_unpacking_done;
10824  __pyx_L5_argtuple_error:;
10825  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
10826  __pyx_L3_error:;
10827  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10828  __Pyx_RefNannyFinishContext();
10829  return -1;
10830  __pyx_L4_argument_unpacking_done:;
10831  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
10832 
10833  /* function exit code */
10834  __Pyx_RefNannyFinishContext();
10835  return __pyx_r;
10836 }
10837 
10838 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
10839  int __pyx_r;
10840  __Pyx_RefNannyDeclarations
10841  int __pyx_t_1;
10842  int __pyx_t_2;
10843  int __pyx_t_3;
10844  int __pyx_t_4;
10845  __Pyx_RefNannySetupContext("__cinit__", 0);
10846 
10847  /* "View.MemoryView":346
10848  *
10849  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10850  * self.obj = obj # <<<<<<<<<<<<<<
10851  * self.flags = flags
10852  * if type(self) is memoryview or obj is not None:
10853  */
10854  __Pyx_INCREF(__pyx_v_obj);
10855  __Pyx_GIVEREF(__pyx_v_obj);
10856  __Pyx_GOTREF(__pyx_v_self->obj);
10857  __Pyx_DECREF(__pyx_v_self->obj);
10858  __pyx_v_self->obj = __pyx_v_obj;
10859 
10860  /* "View.MemoryView":347
10861  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10862  * self.obj = obj
10863  * self.flags = flags # <<<<<<<<<<<<<<
10864  * if type(self) is memoryview or obj is not None:
10865  * __Pyx_GetBuffer(obj, &self.view, flags)
10866  */
10867  __pyx_v_self->flags = __pyx_v_flags;
10868 
10869  /* "View.MemoryView":348
10870  * self.obj = obj
10871  * self.flags = flags
10872  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10873  * __Pyx_GetBuffer(obj, &self.view, flags)
10874  * if <PyObject *> self.view.obj == NULL:
10875  */
10876  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10877  __pyx_t_3 = (__pyx_t_2 != 0);
10878  if (!__pyx_t_3) {
10879  } else {
10880  __pyx_t_1 = __pyx_t_3;
10881  goto __pyx_L4_bool_binop_done;
10882  }
10883  __pyx_t_3 = (__pyx_v_obj != Py_None);
10884  __pyx_t_2 = (__pyx_t_3 != 0);
10885  __pyx_t_1 = __pyx_t_2;
10886  __pyx_L4_bool_binop_done:;
10887  if (__pyx_t_1) {
10888 
10889  /* "View.MemoryView":349
10890  * self.flags = flags
10891  * if type(self) is memoryview or obj is not None:
10892  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
10893  * if <PyObject *> self.view.obj == NULL:
10894  * (<__pyx_buffer *> &self.view).obj = Py_None
10895  */
10896  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
10897 
10898  /* "View.MemoryView":350
10899  * if type(self) is memoryview or obj is not None:
10900  * __Pyx_GetBuffer(obj, &self.view, flags)
10901  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10902  * (<__pyx_buffer *> &self.view).obj = Py_None
10903  * Py_INCREF(Py_None)
10904  */
10905  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10906  if (__pyx_t_1) {
10907 
10908  /* "View.MemoryView":351
10909  * __Pyx_GetBuffer(obj, &self.view, flags)
10910  * if <PyObject *> self.view.obj == NULL:
10911  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
10912  * Py_INCREF(Py_None)
10913  *
10914  */
10915  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10916 
10917  /* "View.MemoryView":352
10918  * if <PyObject *> self.view.obj == NULL:
10919  * (<__pyx_buffer *> &self.view).obj = Py_None
10920  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
10921  *
10922  * global __pyx_memoryview_thread_locks_used
10923  */
10924  Py_INCREF(Py_None);
10925 
10926  /* "View.MemoryView":350
10927  * if type(self) is memoryview or obj is not None:
10928  * __Pyx_GetBuffer(obj, &self.view, flags)
10929  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10930  * (<__pyx_buffer *> &self.view).obj = Py_None
10931  * Py_INCREF(Py_None)
10932  */
10933  }
10934 
10935  /* "View.MemoryView":348
10936  * self.obj = obj
10937  * self.flags = flags
10938  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10939  * __Pyx_GetBuffer(obj, &self.view, flags)
10940  * if <PyObject *> self.view.obj == NULL:
10941  */
10942  }
10943 
10944  /* "View.MemoryView":355
10945  *
10946  * global __pyx_memoryview_thread_locks_used
10947  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10948  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10949  * __pyx_memoryview_thread_locks_used += 1
10950  */
10951  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10952  if (__pyx_t_1) {
10953 
10954  /* "View.MemoryView":356
10955  * global __pyx_memoryview_thread_locks_used
10956  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10957  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
10958  * __pyx_memoryview_thread_locks_used += 1
10959  * if self.lock is NULL:
10960  */
10961  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10962 
10963  /* "View.MemoryView":357
10964  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10965  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10966  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
10967  * if self.lock is NULL:
10968  * self.lock = PyThread_allocate_lock()
10969  */
10970  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10971 
10972  /* "View.MemoryView":355
10973  *
10974  * global __pyx_memoryview_thread_locks_used
10975  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10976  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10977  * __pyx_memoryview_thread_locks_used += 1
10978  */
10979  }
10980 
10981  /* "View.MemoryView":358
10982  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10983  * __pyx_memoryview_thread_locks_used += 1
10984  * if self.lock is NULL: # <<<<<<<<<<<<<<
10985  * self.lock = PyThread_allocate_lock()
10986  * if self.lock is NULL:
10987  */
10988  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10989  if (__pyx_t_1) {
10990 
10991  /* "View.MemoryView":359
10992  * __pyx_memoryview_thread_locks_used += 1
10993  * if self.lock is NULL:
10994  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
10995  * if self.lock is NULL:
10996  * raise MemoryError
10997  */
10998  __pyx_v_self->lock = PyThread_allocate_lock();
10999 
11000  /* "View.MemoryView":360
11001  * if self.lock is NULL:
11002  * self.lock = PyThread_allocate_lock()
11003  * if self.lock is NULL: # <<<<<<<<<<<<<<
11004  * raise MemoryError
11005  *
11006  */
11007  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11008  if (unlikely(__pyx_t_1)) {
11009 
11010  /* "View.MemoryView":361
11011  * self.lock = PyThread_allocate_lock()
11012  * if self.lock is NULL:
11013  * raise MemoryError # <<<<<<<<<<<<<<
11014  *
11015  * if flags & PyBUF_FORMAT:
11016  */
11017  PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
11018 
11019  /* "View.MemoryView":360
11020  * if self.lock is NULL:
11021  * self.lock = PyThread_allocate_lock()
11022  * if self.lock is NULL: # <<<<<<<<<<<<<<
11023  * raise MemoryError
11024  *
11025  */
11026  }
11027 
11028  /* "View.MemoryView":358
11029  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11030  * __pyx_memoryview_thread_locks_used += 1
11031  * if self.lock is NULL: # <<<<<<<<<<<<<<
11032  * self.lock = PyThread_allocate_lock()
11033  * if self.lock is NULL:
11034  */
11035  }
11036 
11037  /* "View.MemoryView":363
11038  * raise MemoryError
11039  *
11040  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11041  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11042  * else:
11043  */
11044  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11045  if (__pyx_t_1) {
11046 
11047  /* "View.MemoryView":364
11048  *
11049  * if flags & PyBUF_FORMAT:
11050  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
11051  * else:
11052  * self.dtype_is_object = dtype_is_object
11053  */
11054  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
11055  if (__pyx_t_2) {
11056  } else {
11057  __pyx_t_1 = __pyx_t_2;
11058  goto __pyx_L11_bool_binop_done;
11059  }
11060  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
11061  __pyx_t_1 = __pyx_t_2;
11062  __pyx_L11_bool_binop_done:;
11063  __pyx_v_self->dtype_is_object = __pyx_t_1;
11064 
11065  /* "View.MemoryView":363
11066  * raise MemoryError
11067  *
11068  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11069  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11070  * else:
11071  */
11072  goto __pyx_L10;
11073  }
11074 
11075  /* "View.MemoryView":366
11076  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11077  * else:
11078  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
11079  *
11080  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11081  */
11082  /*else*/ {
11083  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
11084  }
11085  __pyx_L10:;
11086 
11087  /* "View.MemoryView":368
11088  * self.dtype_is_object = dtype_is_object
11089  *
11090  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
11091  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11092  * self.typeinfo = NULL
11093  */
11094  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
11095 
11096  /* "View.MemoryView":370
11097  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11098  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11099  * self.typeinfo = NULL # <<<<<<<<<<<<<<
11100  *
11101  * def __dealloc__(memoryview self):
11102  */
11103  __pyx_v_self->typeinfo = NULL;
11104 
11105  /* "View.MemoryView":345
11106  * cdef __Pyx_TypeInfo *typeinfo
11107  *
11108  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
11109  * self.obj = obj
11110  * self.flags = flags
11111  */
11112 
11113  /* function exit code */
11114  __pyx_r = 0;
11115  goto __pyx_L0;
11116  __pyx_L1_error:;
11117  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11118  __pyx_r = -1;
11119  __pyx_L0:;
11120  __Pyx_RefNannyFinishContext();
11121  return __pyx_r;
11122 }
11123 
11124 /* "View.MemoryView":372
11125  * self.typeinfo = NULL
11126  *
11127  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11128  * if self.obj is not None:
11129  * __Pyx_ReleaseBuffer(&self.view)
11130  */
11131 
11132 /* Python wrapper */
11133 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
11134 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
11135  __Pyx_RefNannyDeclarations
11136  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
11137  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11138 
11139  /* function exit code */
11140  __Pyx_RefNannyFinishContext();
11141 }
11142 
11143 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
11144  int __pyx_v_i;
11145  __Pyx_RefNannyDeclarations
11146  int __pyx_t_1;
11147  int __pyx_t_2;
11148  int __pyx_t_3;
11149  int __pyx_t_4;
11150  int __pyx_t_5;
11151  PyThread_type_lock __pyx_t_6;
11152  PyThread_type_lock __pyx_t_7;
11153  __Pyx_RefNannySetupContext("__dealloc__", 0);
11154 
11155  /* "View.MemoryView":373
11156  *
11157  * def __dealloc__(memoryview self):
11158  * if self.obj is not None: # <<<<<<<<<<<<<<
11159  * __Pyx_ReleaseBuffer(&self.view)
11160  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11161  */
11162  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
11163  __pyx_t_2 = (__pyx_t_1 != 0);
11164  if (__pyx_t_2) {
11165 
11166  /* "View.MemoryView":374
11167  * def __dealloc__(memoryview self):
11168  * if self.obj is not None:
11169  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
11170  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11171  *
11172  */
11173  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
11174 
11175  /* "View.MemoryView":373
11176  *
11177  * def __dealloc__(memoryview self):
11178  * if self.obj is not None: # <<<<<<<<<<<<<<
11179  * __Pyx_ReleaseBuffer(&self.view)
11180  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11181  */
11182  goto __pyx_L3;
11183  }
11184 
11185  /* "View.MemoryView":375
11186  * if self.obj is not None:
11187  * __Pyx_ReleaseBuffer(&self.view)
11188  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
11189  *
11190  * (<__pyx_buffer *> &self.view).obj = NULL
11191  */
11192  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
11193  if (__pyx_t_2) {
11194 
11195  /* "View.MemoryView":377
11196  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11197  *
11198  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
11199  * Py_DECREF(Py_None)
11200  *
11201  */
11202  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
11203 
11204  /* "View.MemoryView":378
11205  *
11206  * (<__pyx_buffer *> &self.view).obj = NULL
11207  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
11208  *
11209  * cdef int i
11210  */
11211  Py_DECREF(Py_None);
11212 
11213  /* "View.MemoryView":375
11214  * if self.obj is not None:
11215  * __Pyx_ReleaseBuffer(&self.view)
11216  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
11217  *
11218  * (<__pyx_buffer *> &self.view).obj = NULL
11219  */
11220  }
11221  __pyx_L3:;
11222 
11223  /* "View.MemoryView":382
11224  * cdef int i
11225  * global __pyx_memoryview_thread_locks_used
11226  * if self.lock != NULL: # <<<<<<<<<<<<<<
11227  * for i in range(__pyx_memoryview_thread_locks_used):
11228  * if __pyx_memoryview_thread_locks[i] is self.lock:
11229  */
11230  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
11231  if (__pyx_t_2) {
11232 
11233  /* "View.MemoryView":383
11234  * global __pyx_memoryview_thread_locks_used
11235  * if self.lock != NULL:
11236  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
11237  * if __pyx_memoryview_thread_locks[i] is self.lock:
11238  * __pyx_memoryview_thread_locks_used -= 1
11239  */
11240  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
11241  __pyx_t_4 = __pyx_t_3;
11242  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
11243  __pyx_v_i = __pyx_t_5;
11244 
11245  /* "View.MemoryView":384
11246  * if self.lock != NULL:
11247  * for i in range(__pyx_memoryview_thread_locks_used):
11248  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11249  * __pyx_memoryview_thread_locks_used -= 1
11250  * if i != __pyx_memoryview_thread_locks_used:
11251  */
11252  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
11253  if (__pyx_t_2) {
11254 
11255  /* "View.MemoryView":385
11256  * for i in range(__pyx_memoryview_thread_locks_used):
11257  * if __pyx_memoryview_thread_locks[i] is self.lock:
11258  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
11259  * if i != __pyx_memoryview_thread_locks_used:
11260  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11261  */
11262  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
11263 
11264  /* "View.MemoryView":386
11265  * if __pyx_memoryview_thread_locks[i] is self.lock:
11266  * __pyx_memoryview_thread_locks_used -= 1
11267  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11268  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11269  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11270  */
11271  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
11272  if (__pyx_t_2) {
11273 
11274  /* "View.MemoryView":388
11275  * if i != __pyx_memoryview_thread_locks_used:
11276  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11277  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
11278  * break
11279  * else:
11280  */
11281  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11282  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
11283 
11284  /* "View.MemoryView":387
11285  * __pyx_memoryview_thread_locks_used -= 1
11286  * if i != __pyx_memoryview_thread_locks_used:
11287  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
11288  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11289  * break
11290  */
11291  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
11292  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
11293 
11294  /* "View.MemoryView":386
11295  * if __pyx_memoryview_thread_locks[i] is self.lock:
11296  * __pyx_memoryview_thread_locks_used -= 1
11297  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11298  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11299  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11300  */
11301  }
11302 
11303  /* "View.MemoryView":389
11304  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11305  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11306  * break # <<<<<<<<<<<<<<
11307  * else:
11308  * PyThread_free_lock(self.lock)
11309  */
11310  goto __pyx_L6_break;
11311 
11312  /* "View.MemoryView":384
11313  * if self.lock != NULL:
11314  * for i in range(__pyx_memoryview_thread_locks_used):
11315  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11316  * __pyx_memoryview_thread_locks_used -= 1
11317  * if i != __pyx_memoryview_thread_locks_used:
11318  */
11319  }
11320  }
11321  /*else*/ {
11322 
11323  /* "View.MemoryView":391
11324  * break
11325  * else:
11326  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
11327  *
11328  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11329  */
11330  PyThread_free_lock(__pyx_v_self->lock);
11331  }
11332  __pyx_L6_break:;
11333 
11334  /* "View.MemoryView":382
11335  * cdef int i
11336  * global __pyx_memoryview_thread_locks_used
11337  * if self.lock != NULL: # <<<<<<<<<<<<<<
11338  * for i in range(__pyx_memoryview_thread_locks_used):
11339  * if __pyx_memoryview_thread_locks[i] is self.lock:
11340  */
11341  }
11342 
11343  /* "View.MemoryView":372
11344  * self.typeinfo = NULL
11345  *
11346  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11347  * if self.obj is not None:
11348  * __Pyx_ReleaseBuffer(&self.view)
11349  */
11350 
11351  /* function exit code */
11352  __Pyx_RefNannyFinishContext();
11353 }
11354 
11355 /* "View.MemoryView":393
11356  * PyThread_free_lock(self.lock)
11357  *
11358  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11359  * cdef Py_ssize_t dim
11360  * cdef char *itemp = <char *> self.view.buf
11361  */
11362 
11363 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11364  Py_ssize_t __pyx_v_dim;
11365  char *__pyx_v_itemp;
11366  PyObject *__pyx_v_idx = NULL;
11367  char *__pyx_r;
11368  __Pyx_RefNannyDeclarations
11369  Py_ssize_t __pyx_t_1;
11370  PyObject *__pyx_t_2 = NULL;
11371  Py_ssize_t __pyx_t_3;
11372  PyObject *(*__pyx_t_4)(PyObject *);
11373  PyObject *__pyx_t_5 = NULL;
11374  Py_ssize_t __pyx_t_6;
11375  char *__pyx_t_7;
11376  __Pyx_RefNannySetupContext("get_item_pointer", 0);
11377 
11378  /* "View.MemoryView":395
11379  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11380  * cdef Py_ssize_t dim
11381  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
11382  *
11383  * for dim, idx in enumerate(index):
11384  */
11385  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
11386 
11387  /* "View.MemoryView":397
11388  * cdef char *itemp = <char *> self.view.buf
11389  *
11390  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11391  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11392  *
11393  */
11394  __pyx_t_1 = 0;
11395  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11396  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11397  __pyx_t_4 = NULL;
11398  } else {
11399  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
11400  __Pyx_GOTREF(__pyx_t_2);
11401  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
11402  }
11403  for (;;) {
11404  if (likely(!__pyx_t_4)) {
11405  if (likely(PyList_CheckExact(__pyx_t_2))) {
11406  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
11407  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11408  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
11409  #else
11410  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
11411  __Pyx_GOTREF(__pyx_t_5);
11412  #endif
11413  } else {
11414  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
11415  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11416  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
11417  #else
11418  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
11419  __Pyx_GOTREF(__pyx_t_5);
11420  #endif
11421  }
11422  } else {
11423  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
11424  if (unlikely(!__pyx_t_5)) {
11425  PyObject* exc_type = PyErr_Occurred();
11426  if (exc_type) {
11427  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11428  else __PYX_ERR(1, 397, __pyx_L1_error)
11429  }
11430  break;
11431  }
11432  __Pyx_GOTREF(__pyx_t_5);
11433  }
11434  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
11435  __pyx_t_5 = 0;
11436  __pyx_v_dim = __pyx_t_1;
11437  __pyx_t_1 = (__pyx_t_1 + 1);
11438 
11439  /* "View.MemoryView":398
11440  *
11441  * for dim, idx in enumerate(index):
11442  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
11443  *
11444  * return itemp
11445  */
11446  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
11447  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
11448  __pyx_v_itemp = __pyx_t_7;
11449 
11450  /* "View.MemoryView":397
11451  * cdef char *itemp = <char *> self.view.buf
11452  *
11453  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11454  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11455  *
11456  */
11457  }
11458  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11459 
11460  /* "View.MemoryView":400
11461  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11462  *
11463  * return itemp # <<<<<<<<<<<<<<
11464  *
11465  *
11466  */
11467  __pyx_r = __pyx_v_itemp;
11468  goto __pyx_L0;
11469 
11470  /* "View.MemoryView":393
11471  * PyThread_free_lock(self.lock)
11472  *
11473  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11474  * cdef Py_ssize_t dim
11475  * cdef char *itemp = <char *> self.view.buf
11476  */
11477 
11478  /* function exit code */
11479  __pyx_L1_error:;
11480  __Pyx_XDECREF(__pyx_t_2);
11481  __Pyx_XDECREF(__pyx_t_5);
11482  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11483  __pyx_r = NULL;
11484  __pyx_L0:;
11485  __Pyx_XDECREF(__pyx_v_idx);
11486  __Pyx_RefNannyFinishContext();
11487  return __pyx_r;
11488 }
11489 
11490 /* "View.MemoryView":403
11491  *
11492  *
11493  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11494  * if index is Ellipsis:
11495  * return self
11496  */
11497 
11498 /* Python wrapper */
11499 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
11500 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11501  PyObject *__pyx_r = 0;
11502  __Pyx_RefNannyDeclarations
11503  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
11504  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11505 
11506  /* function exit code */
11507  __Pyx_RefNannyFinishContext();
11508  return __pyx_r;
11509 }
11510 
11511 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11512  PyObject *__pyx_v_have_slices = NULL;
11513  PyObject *__pyx_v_indices = NULL;
11514  char *__pyx_v_itemp;
11515  PyObject *__pyx_r = NULL;
11516  __Pyx_RefNannyDeclarations
11517  int __pyx_t_1;
11518  int __pyx_t_2;
11519  PyObject *__pyx_t_3 = NULL;
11520  PyObject *__pyx_t_4 = NULL;
11521  PyObject *__pyx_t_5 = NULL;
11522  char *__pyx_t_6;
11523  __Pyx_RefNannySetupContext("__getitem__", 0);
11524 
11525  /* "View.MemoryView":404
11526  *
11527  * def __getitem__(memoryview self, object index):
11528  * if index is Ellipsis: # <<<<<<<<<<<<<<
11529  * return self
11530  *
11531  */
11532  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
11533  __pyx_t_2 = (__pyx_t_1 != 0);
11534  if (__pyx_t_2) {
11535 
11536  /* "View.MemoryView":405
11537  * def __getitem__(memoryview self, object index):
11538  * if index is Ellipsis:
11539  * return self # <<<<<<<<<<<<<<
11540  *
11541  * have_slices, indices = _unellipsify(index, self.view.ndim)
11542  */
11543  __Pyx_XDECREF(__pyx_r);
11544  __Pyx_INCREF(((PyObject *)__pyx_v_self));
11545  __pyx_r = ((PyObject *)__pyx_v_self);
11546  goto __pyx_L0;
11547 
11548  /* "View.MemoryView":404
11549  *
11550  * def __getitem__(memoryview self, object index):
11551  * if index is Ellipsis: # <<<<<<<<<<<<<<
11552  * return self
11553  *
11554  */
11555  }
11556 
11557  /* "View.MemoryView":407
11558  * return self
11559  *
11560  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11561  *
11562  * cdef char *itemp
11563  */
11564  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
11565  __Pyx_GOTREF(__pyx_t_3);
11566  if (likely(__pyx_t_3 != Py_None)) {
11567  PyObject* sequence = __pyx_t_3;
11568  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11569  if (unlikely(size != 2)) {
11570  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11571  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11572  __PYX_ERR(1, 407, __pyx_L1_error)
11573  }
11574  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11575  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
11576  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
11577  __Pyx_INCREF(__pyx_t_4);
11578  __Pyx_INCREF(__pyx_t_5);
11579  #else
11580  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
11581  __Pyx_GOTREF(__pyx_t_4);
11582  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
11583  __Pyx_GOTREF(__pyx_t_5);
11584  #endif
11585  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11586  } else {
11587  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
11588  }
11589  __pyx_v_have_slices = __pyx_t_4;
11590  __pyx_t_4 = 0;
11591  __pyx_v_indices = __pyx_t_5;
11592  __pyx_t_5 = 0;
11593 
11594  /* "View.MemoryView":410
11595  *
11596  * cdef char *itemp
11597  * if have_slices: # <<<<<<<<<<<<<<
11598  * return memview_slice(self, indices)
11599  * else:
11600  */
11601  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
11602  if (__pyx_t_2) {
11603 
11604  /* "View.MemoryView":411
11605  * cdef char *itemp
11606  * if have_slices:
11607  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
11608  * else:
11609  * itemp = self.get_item_pointer(indices)
11610  */
11611  __Pyx_XDECREF(__pyx_r);
11612  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
11613  __Pyx_GOTREF(__pyx_t_3);
11614  __pyx_r = __pyx_t_3;
11615  __pyx_t_3 = 0;
11616  goto __pyx_L0;
11617 
11618  /* "View.MemoryView":410
11619  *
11620  * cdef char *itemp
11621  * if have_slices: # <<<<<<<<<<<<<<
11622  * return memview_slice(self, indices)
11623  * else:
11624  */
11625  }
11626 
11627  /* "View.MemoryView":413
11628  * return memview_slice(self, indices)
11629  * else:
11630  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
11631  * return self.convert_item_to_object(itemp)
11632  *
11633  */
11634  /*else*/ {
11635  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
11636  __pyx_v_itemp = __pyx_t_6;
11637 
11638  /* "View.MemoryView":414
11639  * else:
11640  * itemp = self.get_item_pointer(indices)
11641  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
11642  *
11643  * def __setitem__(memoryview self, object index, object value):
11644  */
11645  __Pyx_XDECREF(__pyx_r);
11646  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
11647  __Pyx_GOTREF(__pyx_t_3);
11648  __pyx_r = __pyx_t_3;
11649  __pyx_t_3 = 0;
11650  goto __pyx_L0;
11651  }
11652 
11653  /* "View.MemoryView":403
11654  *
11655  *
11656  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11657  * if index is Ellipsis:
11658  * return self
11659  */
11660 
11661  /* function exit code */
11662  __pyx_L1_error:;
11663  __Pyx_XDECREF(__pyx_t_3);
11664  __Pyx_XDECREF(__pyx_t_4);
11665  __Pyx_XDECREF(__pyx_t_5);
11666  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11667  __pyx_r = NULL;
11668  __pyx_L0:;
11669  __Pyx_XDECREF(__pyx_v_have_slices);
11670  __Pyx_XDECREF(__pyx_v_indices);
11671  __Pyx_XGIVEREF(__pyx_r);
11672  __Pyx_RefNannyFinishContext();
11673  return __pyx_r;
11674 }
11675 
11676 /* "View.MemoryView":416
11677  * return self.convert_item_to_object(itemp)
11678  *
11679  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11680  * if self.view.readonly:
11681  * raise TypeError("Cannot assign to read-only memoryview")
11682  */
11683 
11684 /* Python wrapper */
11685 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
11686 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11687  int __pyx_r;
11688  __Pyx_RefNannyDeclarations
11689  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
11690  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
11691 
11692  /* function exit code */
11693  __Pyx_RefNannyFinishContext();
11694  return __pyx_r;
11695 }
11696 
11697 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11698  PyObject *__pyx_v_have_slices = NULL;
11699  PyObject *__pyx_v_obj = NULL;
11700  int __pyx_r;
11701  __Pyx_RefNannyDeclarations
11702  int __pyx_t_1;
11703  PyObject *__pyx_t_2 = NULL;
11704  PyObject *__pyx_t_3 = NULL;
11705  PyObject *__pyx_t_4 = NULL;
11706  __Pyx_RefNannySetupContext("__setitem__", 0);
11707  __Pyx_INCREF(__pyx_v_index);
11708 
11709  /* "View.MemoryView":417
11710  *
11711  * def __setitem__(memoryview self, object index, object value):
11712  * if self.view.readonly: # <<<<<<<<<<<<<<
11713  * raise TypeError("Cannot assign to read-only memoryview")
11714  *
11715  */
11716  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11717  if (unlikely(__pyx_t_1)) {
11718 
11719  /* "View.MemoryView":418
11720  * def __setitem__(memoryview self, object index, object value):
11721  * if self.view.readonly:
11722  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
11723  *
11724  * have_slices, index = _unellipsify(index, self.view.ndim)
11725  */
11726  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
11727  __Pyx_GOTREF(__pyx_t_2);
11728  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11729  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11730  __PYX_ERR(1, 418, __pyx_L1_error)
11731 
11732  /* "View.MemoryView":417
11733  *
11734  * def __setitem__(memoryview self, object index, object value):
11735  * if self.view.readonly: # <<<<<<<<<<<<<<
11736  * raise TypeError("Cannot assign to read-only memoryview")
11737  *
11738  */
11739  }
11740 
11741  /* "View.MemoryView":420
11742  * raise TypeError("Cannot assign to read-only memoryview")
11743  *
11744  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11745  *
11746  * if have_slices:
11747  */
11748  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
11749  __Pyx_GOTREF(__pyx_t_2);
11750  if (likely(__pyx_t_2 != Py_None)) {
11751  PyObject* sequence = __pyx_t_2;
11752  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11753  if (unlikely(size != 2)) {
11754  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11755  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11756  __PYX_ERR(1, 420, __pyx_L1_error)
11757  }
11758  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11759  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11760  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11761  __Pyx_INCREF(__pyx_t_3);
11762  __Pyx_INCREF(__pyx_t_4);
11763  #else
11764  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
11765  __Pyx_GOTREF(__pyx_t_3);
11766  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
11767  __Pyx_GOTREF(__pyx_t_4);
11768  #endif
11769  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11770  } else {
11771  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
11772  }
11773  __pyx_v_have_slices = __pyx_t_3;
11774  __pyx_t_3 = 0;
11775  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11776  __pyx_t_4 = 0;
11777 
11778  /* "View.MemoryView":422
11779  * have_slices, index = _unellipsify(index, self.view.ndim)
11780  *
11781  * if have_slices: # <<<<<<<<<<<<<<
11782  * obj = self.is_slice(value)
11783  * if obj:
11784  */
11785  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
11786  if (__pyx_t_1) {
11787 
11788  /* "View.MemoryView":423
11789  *
11790  * if have_slices:
11791  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
11792  * if obj:
11793  * self.setitem_slice_assignment(self[index], obj)
11794  */
11795  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
11796  __Pyx_GOTREF(__pyx_t_2);
11797  __pyx_v_obj = __pyx_t_2;
11798  __pyx_t_2 = 0;
11799 
11800  /* "View.MemoryView":424
11801  * if have_slices:
11802  * obj = self.is_slice(value)
11803  * if obj: # <<<<<<<<<<<<<<
11804  * self.setitem_slice_assignment(self[index], obj)
11805  * else:
11806  */
11807  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
11808  if (__pyx_t_1) {
11809 
11810  /* "View.MemoryView":425
11811  * obj = self.is_slice(value)
11812  * if obj:
11813  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
11814  * else:
11815  * self.setitem_slice_assign_scalar(self[index], value)
11816  */
11817  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
11818  __Pyx_GOTREF(__pyx_t_2);
11819  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
11820  __Pyx_GOTREF(__pyx_t_4);
11821  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11822  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11823 
11824  /* "View.MemoryView":424
11825  * if have_slices:
11826  * obj = self.is_slice(value)
11827  * if obj: # <<<<<<<<<<<<<<
11828  * self.setitem_slice_assignment(self[index], obj)
11829  * else:
11830  */
11831  goto __pyx_L5;
11832  }
11833 
11834  /* "View.MemoryView":427
11835  * self.setitem_slice_assignment(self[index], obj)
11836  * else:
11837  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
11838  * else:
11839  * self.setitem_indexed(index, value)
11840  */
11841  /*else*/ {
11842  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
11843  __Pyx_GOTREF(__pyx_t_4);
11844  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
11845  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
11846  __Pyx_GOTREF(__pyx_t_2);
11847  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11848  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11849  }
11850  __pyx_L5:;
11851 
11852  /* "View.MemoryView":422
11853  * have_slices, index = _unellipsify(index, self.view.ndim)
11854  *
11855  * if have_slices: # <<<<<<<<<<<<<<
11856  * obj = self.is_slice(value)
11857  * if obj:
11858  */
11859  goto __pyx_L4;
11860  }
11861 
11862  /* "View.MemoryView":429
11863  * self.setitem_slice_assign_scalar(self[index], value)
11864  * else:
11865  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
11866  *
11867  * cdef is_slice(self, obj):
11868  */
11869  /*else*/ {
11870  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
11871  __Pyx_GOTREF(__pyx_t_2);
11872  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11873  }
11874  __pyx_L4:;
11875 
11876  /* "View.MemoryView":416
11877  * return self.convert_item_to_object(itemp)
11878  *
11879  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11880  * if self.view.readonly:
11881  * raise TypeError("Cannot assign to read-only memoryview")
11882  */
11883 
11884  /* function exit code */
11885  __pyx_r = 0;
11886  goto __pyx_L0;
11887  __pyx_L1_error:;
11888  __Pyx_XDECREF(__pyx_t_2);
11889  __Pyx_XDECREF(__pyx_t_3);
11890  __Pyx_XDECREF(__pyx_t_4);
11891  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11892  __pyx_r = -1;
11893  __pyx_L0:;
11894  __Pyx_XDECREF(__pyx_v_have_slices);
11895  __Pyx_XDECREF(__pyx_v_obj);
11896  __Pyx_XDECREF(__pyx_v_index);
11897  __Pyx_RefNannyFinishContext();
11898  return __pyx_r;
11899 }
11900 
11901 /* "View.MemoryView":431
11902  * self.setitem_indexed(index, value)
11903  *
11904  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11905  * if not isinstance(obj, memoryview):
11906  * try:
11907  */
11908 
11909 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11910  PyObject *__pyx_r = NULL;
11911  __Pyx_RefNannyDeclarations
11912  int __pyx_t_1;
11913  int __pyx_t_2;
11914  PyObject *__pyx_t_3 = NULL;
11915  PyObject *__pyx_t_4 = NULL;
11916  PyObject *__pyx_t_5 = NULL;
11917  PyObject *__pyx_t_6 = NULL;
11918  PyObject *__pyx_t_7 = NULL;
11919  PyObject *__pyx_t_8 = NULL;
11920  int __pyx_t_9;
11921  __Pyx_RefNannySetupContext("is_slice", 0);
11922  __Pyx_INCREF(__pyx_v_obj);
11923 
11924  /* "View.MemoryView":432
11925  *
11926  * cdef is_slice(self, obj):
11927  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11928  * try:
11929  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11930  */
11931  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11932  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11933  if (__pyx_t_2) {
11934 
11935  /* "View.MemoryView":433
11936  * cdef is_slice(self, obj):
11937  * if not isinstance(obj, memoryview):
11938  * try: # <<<<<<<<<<<<<<
11939  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11940  * self.dtype_is_object)
11941  */
11942  {
11943  __Pyx_PyThreadState_declare
11944  __Pyx_PyThreadState_assign
11945  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11946  __Pyx_XGOTREF(__pyx_t_3);
11947  __Pyx_XGOTREF(__pyx_t_4);
11948  __Pyx_XGOTREF(__pyx_t_5);
11949  /*try:*/ {
11950 
11951  /* "View.MemoryView":434
11952  * if not isinstance(obj, memoryview):
11953  * try:
11954  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11955  * self.dtype_is_object)
11956  * except TypeError:
11957  */
11958  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
11959  __Pyx_GOTREF(__pyx_t_6);
11960 
11961  /* "View.MemoryView":435
11962  * try:
11963  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11964  * self.dtype_is_object) # <<<<<<<<<<<<<<
11965  * except TypeError:
11966  * return None
11967  */
11968  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
11969  __Pyx_GOTREF(__pyx_t_7);
11970 
11971  /* "View.MemoryView":434
11972  * if not isinstance(obj, memoryview):
11973  * try:
11974  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11975  * self.dtype_is_object)
11976  * except TypeError:
11977  */
11978  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
11979  __Pyx_GOTREF(__pyx_t_8);
11980  __Pyx_INCREF(__pyx_v_obj);
11981  __Pyx_GIVEREF(__pyx_v_obj);
11982  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11983  __Pyx_GIVEREF(__pyx_t_6);
11984  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11985  __Pyx_GIVEREF(__pyx_t_7);
11986  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11987  __pyx_t_6 = 0;
11988  __pyx_t_7 = 0;
11989  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
11990  __Pyx_GOTREF(__pyx_t_7);
11991  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11992  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11993  __pyx_t_7 = 0;
11994 
11995  /* "View.MemoryView":433
11996  * cdef is_slice(self, obj):
11997  * if not isinstance(obj, memoryview):
11998  * try: # <<<<<<<<<<<<<<
11999  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12000  * self.dtype_is_object)
12001  */
12002  }
12003  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12004  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12005  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12006  goto __pyx_L9_try_end;
12007  __pyx_L4_error:;
12008  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12009  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12010  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12011 
12012  /* "View.MemoryView":436
12013  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12014  * self.dtype_is_object)
12015  * except TypeError: # <<<<<<<<<<<<<<
12016  * return None
12017  *
12018  */
12019  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
12020  if (__pyx_t_9) {
12021  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12022  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
12023  __Pyx_GOTREF(__pyx_t_7);
12024  __Pyx_GOTREF(__pyx_t_8);
12025  __Pyx_GOTREF(__pyx_t_6);
12026 
12027  /* "View.MemoryView":437
12028  * self.dtype_is_object)
12029  * except TypeError:
12030  * return None # <<<<<<<<<<<<<<
12031  *
12032  * return obj
12033  */
12034  __Pyx_XDECREF(__pyx_r);
12035  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12036  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12037  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12038  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12039  goto __pyx_L7_except_return;
12040  }
12041  goto __pyx_L6_except_error;
12042  __pyx_L6_except_error:;
12043 
12044  /* "View.MemoryView":433
12045  * cdef is_slice(self, obj):
12046  * if not isinstance(obj, memoryview):
12047  * try: # <<<<<<<<<<<<<<
12048  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12049  * self.dtype_is_object)
12050  */
12051  __Pyx_XGIVEREF(__pyx_t_3);
12052  __Pyx_XGIVEREF(__pyx_t_4);
12053  __Pyx_XGIVEREF(__pyx_t_5);
12054  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12055  goto __pyx_L1_error;
12056  __pyx_L7_except_return:;
12057  __Pyx_XGIVEREF(__pyx_t_3);
12058  __Pyx_XGIVEREF(__pyx_t_4);
12059  __Pyx_XGIVEREF(__pyx_t_5);
12060  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12061  goto __pyx_L0;
12062  __pyx_L9_try_end:;
12063  }
12064 
12065  /* "View.MemoryView":432
12066  *
12067  * cdef is_slice(self, obj):
12068  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
12069  * try:
12070  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12071  */
12072  }
12073 
12074  /* "View.MemoryView":439
12075  * return None
12076  *
12077  * return obj # <<<<<<<<<<<<<<
12078  *
12079  * cdef setitem_slice_assignment(self, dst, src):
12080  */
12081  __Pyx_XDECREF(__pyx_r);
12082  __Pyx_INCREF(__pyx_v_obj);
12083  __pyx_r = __pyx_v_obj;
12084  goto __pyx_L0;
12085 
12086  /* "View.MemoryView":431
12087  * self.setitem_indexed(index, value)
12088  *
12089  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
12090  * if not isinstance(obj, memoryview):
12091  * try:
12092  */
12093 
12094  /* function exit code */
12095  __pyx_L1_error:;
12096  __Pyx_XDECREF(__pyx_t_6);
12097  __Pyx_XDECREF(__pyx_t_7);
12098  __Pyx_XDECREF(__pyx_t_8);
12099  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12100  __pyx_r = 0;
12101  __pyx_L0:;
12102  __Pyx_XDECREF(__pyx_v_obj);
12103  __Pyx_XGIVEREF(__pyx_r);
12104  __Pyx_RefNannyFinishContext();
12105  return __pyx_r;
12106 }
12107 
12108 /* "View.MemoryView":441
12109  * return obj
12110  *
12111  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12112  * cdef __Pyx_memviewslice dst_slice
12113  * cdef __Pyx_memviewslice src_slice
12114  */
12115 
12116 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
12117  __Pyx_memviewslice __pyx_v_dst_slice;
12118  __Pyx_memviewslice __pyx_v_src_slice;
12119  PyObject *__pyx_r = NULL;
12120  __Pyx_RefNannyDeclarations
12121  __Pyx_memviewslice *__pyx_t_1;
12122  __Pyx_memviewslice *__pyx_t_2;
12123  PyObject *__pyx_t_3 = NULL;
12124  int __pyx_t_4;
12125  int __pyx_t_5;
12126  int __pyx_t_6;
12127  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
12128 
12129  /* "View.MemoryView":445
12130  * cdef __Pyx_memviewslice src_slice
12131  *
12132  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12133  * get_slice_from_memview(dst, &dst_slice)[0],
12134  * src.ndim, dst.ndim, self.dtype_is_object)
12135  */
12136  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
12137  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
12138 
12139  /* "View.MemoryView":446
12140  *
12141  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12142  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
12143  * src.ndim, dst.ndim, self.dtype_is_object)
12144  *
12145  */
12146  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
12147  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
12148 
12149  /* "View.MemoryView":447
12150  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12151  * get_slice_from_memview(dst, &dst_slice)[0],
12152  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
12153  *
12154  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12155  */
12156  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
12157  __Pyx_GOTREF(__pyx_t_3);
12158  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
12159  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12160  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
12161  __Pyx_GOTREF(__pyx_t_3);
12162  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
12163  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12164 
12165  /* "View.MemoryView":445
12166  * cdef __Pyx_memviewslice src_slice
12167  *
12168  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12169  * get_slice_from_memview(dst, &dst_slice)[0],
12170  * src.ndim, dst.ndim, self.dtype_is_object)
12171  */
12172  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
12173 
12174  /* "View.MemoryView":441
12175  * return obj
12176  *
12177  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12178  * cdef __Pyx_memviewslice dst_slice
12179  * cdef __Pyx_memviewslice src_slice
12180  */
12181 
12182  /* function exit code */
12183  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12184  goto __pyx_L0;
12185  __pyx_L1_error:;
12186  __Pyx_XDECREF(__pyx_t_3);
12187  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
12188  __pyx_r = 0;
12189  __pyx_L0:;
12190  __Pyx_XGIVEREF(__pyx_r);
12191  __Pyx_RefNannyFinishContext();
12192  return __pyx_r;
12193 }
12194 
12195 /* "View.MemoryView":449
12196  * src.ndim, dst.ndim, self.dtype_is_object)
12197  *
12198  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12199  * cdef int array[128]
12200  * cdef void *tmp = NULL
12201  */
12202 
12203 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
12204  int __pyx_v_array[0x80];
12205  void *__pyx_v_tmp;
12206  void *__pyx_v_item;
12207  __Pyx_memviewslice *__pyx_v_dst_slice;
12208  __Pyx_memviewslice __pyx_v_tmp_slice;
12209  PyObject *__pyx_r = NULL;
12210  __Pyx_RefNannyDeclarations
12211  __Pyx_memviewslice *__pyx_t_1;
12212  int __pyx_t_2;
12213  PyObject *__pyx_t_3 = NULL;
12214  int __pyx_t_4;
12215  int __pyx_t_5;
12216  char const *__pyx_t_6;
12217  PyObject *__pyx_t_7 = NULL;
12218  PyObject *__pyx_t_8 = NULL;
12219  PyObject *__pyx_t_9 = NULL;
12220  PyObject *__pyx_t_10 = NULL;
12221  PyObject *__pyx_t_11 = NULL;
12222  PyObject *__pyx_t_12 = NULL;
12223  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
12224 
12225  /* "View.MemoryView":451
12226  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12227  * cdef int array[128]
12228  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
12229  * cdef void *item
12230  *
12231  */
12232  __pyx_v_tmp = NULL;
12233 
12234  /* "View.MemoryView":456
12235  * cdef __Pyx_memviewslice *dst_slice
12236  * cdef __Pyx_memviewslice tmp_slice
12237  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
12238  *
12239  * if <size_t>self.view.itemsize > sizeof(array):
12240  */
12241  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
12242  __pyx_v_dst_slice = __pyx_t_1;
12243 
12244  /* "View.MemoryView":458
12245  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12246  *
12247  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12248  * tmp = PyMem_Malloc(self.view.itemsize)
12249  * if tmp == NULL:
12250  */
12251  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
12252  if (__pyx_t_2) {
12253 
12254  /* "View.MemoryView":459
12255  *
12256  * if <size_t>self.view.itemsize > sizeof(array):
12257  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
12258  * if tmp == NULL:
12259  * raise MemoryError
12260  */
12261  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
12262 
12263  /* "View.MemoryView":460
12264  * if <size_t>self.view.itemsize > sizeof(array):
12265  * tmp = PyMem_Malloc(self.view.itemsize)
12266  * if tmp == NULL: # <<<<<<<<<<<<<<
12267  * raise MemoryError
12268  * item = tmp
12269  */
12270  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
12271  if (unlikely(__pyx_t_2)) {
12272 
12273  /* "View.MemoryView":461
12274  * tmp = PyMem_Malloc(self.view.itemsize)
12275  * if tmp == NULL:
12276  * raise MemoryError # <<<<<<<<<<<<<<
12277  * item = tmp
12278  * else:
12279  */
12280  PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
12281 
12282  /* "View.MemoryView":460
12283  * if <size_t>self.view.itemsize > sizeof(array):
12284  * tmp = PyMem_Malloc(self.view.itemsize)
12285  * if tmp == NULL: # <<<<<<<<<<<<<<
12286  * raise MemoryError
12287  * item = tmp
12288  */
12289  }
12290 
12291  /* "View.MemoryView":462
12292  * if tmp == NULL:
12293  * raise MemoryError
12294  * item = tmp # <<<<<<<<<<<<<<
12295  * else:
12296  * item = <void *> array
12297  */
12298  __pyx_v_item = __pyx_v_tmp;
12299 
12300  /* "View.MemoryView":458
12301  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12302  *
12303  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12304  * tmp = PyMem_Malloc(self.view.itemsize)
12305  * if tmp == NULL:
12306  */
12307  goto __pyx_L3;
12308  }
12309 
12310  /* "View.MemoryView":464
12311  * item = tmp
12312  * else:
12313  * item = <void *> array # <<<<<<<<<<<<<<
12314  *
12315  * try:
12316  */
12317  /*else*/ {
12318  __pyx_v_item = ((void *)__pyx_v_array);
12319  }
12320  __pyx_L3:;
12321 
12322  /* "View.MemoryView":466
12323  * item = <void *> array
12324  *
12325  * try: # <<<<<<<<<<<<<<
12326  * if self.dtype_is_object:
12327  * (<PyObject **> item)[0] = <PyObject *> value
12328  */
12329  /*try:*/ {
12330 
12331  /* "View.MemoryView":467
12332  *
12333  * try:
12334  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12335  * (<PyObject **> item)[0] = <PyObject *> value
12336  * else:
12337  */
12338  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
12339  if (__pyx_t_2) {
12340 
12341  /* "View.MemoryView":468
12342  * try:
12343  * if self.dtype_is_object:
12344  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
12345  * else:
12346  * self.assign_item_from_object(<char *> item, value)
12347  */
12348  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12349 
12350  /* "View.MemoryView":467
12351  *
12352  * try:
12353  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12354  * (<PyObject **> item)[0] = <PyObject *> value
12355  * else:
12356  */
12357  goto __pyx_L8;
12358  }
12359 
12360  /* "View.MemoryView":470
12361  * (<PyObject **> item)[0] = <PyObject *> value
12362  * else:
12363  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
12364  *
12365  *
12366  */
12367  /*else*/ {
12368  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
12369  __Pyx_GOTREF(__pyx_t_3);
12370  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12371  }
12372  __pyx_L8:;
12373 
12374  /* "View.MemoryView":474
12375  *
12376  *
12377  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12378  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12379  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12380  */
12381  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12382  if (__pyx_t_2) {
12383 
12384  /* "View.MemoryView":475
12385  *
12386  * if self.view.suboffsets != NULL:
12387  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
12388  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12389  * item, self.dtype_is_object)
12390  */
12391  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
12392  __Pyx_GOTREF(__pyx_t_3);
12393  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12394 
12395  /* "View.MemoryView":474
12396  *
12397  *
12398  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12399  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12400  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12401  */
12402  }
12403 
12404  /* "View.MemoryView":476
12405  * if self.view.suboffsets != NULL:
12406  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12407  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
12408  * item, self.dtype_is_object)
12409  * finally:
12410  */
12411  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
12412  }
12413 
12414  /* "View.MemoryView":479
12415  * item, self.dtype_is_object)
12416  * finally:
12417  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
12418  *
12419  * cdef setitem_indexed(self, index, value):
12420  */
12421  /*finally:*/ {
12422  /*normal exit:*/{
12423  PyMem_Free(__pyx_v_tmp);
12424  goto __pyx_L7;
12425  }
12426  __pyx_L6_error:;
12427  /*exception exit:*/{
12428  __Pyx_PyThreadState_declare
12429  __Pyx_PyThreadState_assign
12430  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12431  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12432  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
12433  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
12434  __Pyx_XGOTREF(__pyx_t_7);
12435  __Pyx_XGOTREF(__pyx_t_8);
12436  __Pyx_XGOTREF(__pyx_t_9);
12437  __Pyx_XGOTREF(__pyx_t_10);
12438  __Pyx_XGOTREF(__pyx_t_11);
12439  __Pyx_XGOTREF(__pyx_t_12);
12440  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
12441  {
12442  PyMem_Free(__pyx_v_tmp);
12443  }
12444  if (PY_MAJOR_VERSION >= 3) {
12445  __Pyx_XGIVEREF(__pyx_t_10);
12446  __Pyx_XGIVEREF(__pyx_t_11);
12447  __Pyx_XGIVEREF(__pyx_t_12);
12448  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
12449  }
12450  __Pyx_XGIVEREF(__pyx_t_7);
12451  __Pyx_XGIVEREF(__pyx_t_8);
12452  __Pyx_XGIVEREF(__pyx_t_9);
12453  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
12454  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12455  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
12456  goto __pyx_L1_error;
12457  }
12458  __pyx_L7:;
12459  }
12460 
12461  /* "View.MemoryView":449
12462  * src.ndim, dst.ndim, self.dtype_is_object)
12463  *
12464  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12465  * cdef int array[128]
12466  * cdef void *tmp = NULL
12467  */
12468 
12469  /* function exit code */
12470  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12471  goto __pyx_L0;
12472  __pyx_L1_error:;
12473  __Pyx_XDECREF(__pyx_t_3);
12474  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12475  __pyx_r = 0;
12476  __pyx_L0:;
12477  __Pyx_XGIVEREF(__pyx_r);
12478  __Pyx_RefNannyFinishContext();
12479  return __pyx_r;
12480 }
12481 
12482 /* "View.MemoryView":481
12483  * PyMem_Free(tmp)
12484  *
12485  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12486  * cdef char *itemp = self.get_item_pointer(index)
12487  * self.assign_item_from_object(itemp, value)
12488  */
12489 
12490 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12491  char *__pyx_v_itemp;
12492  PyObject *__pyx_r = NULL;
12493  __Pyx_RefNannyDeclarations
12494  char *__pyx_t_1;
12495  PyObject *__pyx_t_2 = NULL;
12496  __Pyx_RefNannySetupContext("setitem_indexed", 0);
12497 
12498  /* "View.MemoryView":482
12499  *
12500  * cdef setitem_indexed(self, index, value):
12501  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
12502  * self.assign_item_from_object(itemp, value)
12503  *
12504  */
12505  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
12506  __pyx_v_itemp = __pyx_t_1;
12507 
12508  /* "View.MemoryView":483
12509  * cdef setitem_indexed(self, index, value):
12510  * cdef char *itemp = self.get_item_pointer(index)
12511  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
12512  *
12513  * cdef convert_item_to_object(self, char *itemp):
12514  */
12515  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
12516  __Pyx_GOTREF(__pyx_t_2);
12517  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12518 
12519  /* "View.MemoryView":481
12520  * PyMem_Free(tmp)
12521  *
12522  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12523  * cdef char *itemp = self.get_item_pointer(index)
12524  * self.assign_item_from_object(itemp, value)
12525  */
12526 
12527  /* function exit code */
12528  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12529  goto __pyx_L0;
12530  __pyx_L1_error:;
12531  __Pyx_XDECREF(__pyx_t_2);
12532  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
12533  __pyx_r = 0;
12534  __pyx_L0:;
12535  __Pyx_XGIVEREF(__pyx_r);
12536  __Pyx_RefNannyFinishContext();
12537  return __pyx_r;
12538 }
12539 
12540 /* "View.MemoryView":485
12541  * self.assign_item_from_object(itemp, value)
12542  *
12543  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12544  * """Only used if instantiated manually by the user, or if Cython doesn't
12545  * know how to convert the type"""
12546  */
12547 
12548 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
12549  PyObject *__pyx_v_struct = NULL;
12550  PyObject *__pyx_v_bytesitem = 0;
12551  PyObject *__pyx_v_result = NULL;
12552  PyObject *__pyx_r = NULL;
12553  __Pyx_RefNannyDeclarations
12554  PyObject *__pyx_t_1 = NULL;
12555  PyObject *__pyx_t_2 = NULL;
12556  PyObject *__pyx_t_3 = NULL;
12557  PyObject *__pyx_t_4 = NULL;
12558  PyObject *__pyx_t_5 = NULL;
12559  PyObject *__pyx_t_6 = NULL;
12560  PyObject *__pyx_t_7 = NULL;
12561  int __pyx_t_8;
12562  PyObject *__pyx_t_9 = NULL;
12563  size_t __pyx_t_10;
12564  int __pyx_t_11;
12565  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
12566 
12567  /* "View.MemoryView":488
12568  * """Only used if instantiated manually by the user, or if Cython doesn't
12569  * know how to convert the type"""
12570  * import struct # <<<<<<<<<<<<<<
12571  * cdef bytes bytesitem
12572  *
12573  */
12574  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
12575  __Pyx_GOTREF(__pyx_t_1);
12576  __pyx_v_struct = __pyx_t_1;
12577  __pyx_t_1 = 0;
12578 
12579  /* "View.MemoryView":491
12580  * cdef bytes bytesitem
12581  *
12582  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
12583  * try:
12584  * result = struct.unpack(self.view.format, bytesitem)
12585  */
12586  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
12587  __Pyx_GOTREF(__pyx_t_1);
12588  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12589  __pyx_t_1 = 0;
12590 
12591  /* "View.MemoryView":492
12592  *
12593  * bytesitem = itemp[:self.view.itemsize]
12594  * try: # <<<<<<<<<<<<<<
12595  * result = struct.unpack(self.view.format, bytesitem)
12596  * except struct.error:
12597  */
12598  {
12599  __Pyx_PyThreadState_declare
12600  __Pyx_PyThreadState_assign
12601  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12602  __Pyx_XGOTREF(__pyx_t_2);
12603  __Pyx_XGOTREF(__pyx_t_3);
12604  __Pyx_XGOTREF(__pyx_t_4);
12605  /*try:*/ {
12606 
12607  /* "View.MemoryView":493
12608  * bytesitem = itemp[:self.view.itemsize]
12609  * try:
12610  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
12611  * except struct.error:
12612  * raise ValueError("Unable to convert item to object")
12613  */
12614  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
12615  __Pyx_GOTREF(__pyx_t_5);
12616  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
12617  __Pyx_GOTREF(__pyx_t_6);
12618  __pyx_t_7 = NULL;
12619  __pyx_t_8 = 0;
12620  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12621  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12622  if (likely(__pyx_t_7)) {
12623  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
12624  __Pyx_INCREF(__pyx_t_7);
12625  __Pyx_INCREF(function);
12626  __Pyx_DECREF_SET(__pyx_t_5, function);
12627  __pyx_t_8 = 1;
12628  }
12629  }
12630  #if CYTHON_FAST_PYCALL
12631  if (PyFunction_Check(__pyx_t_5)) {
12632  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12633  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12634  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12635  __Pyx_GOTREF(__pyx_t_1);
12636  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12637  } else
12638  #endif
12639  #if CYTHON_FAST_PYCCALL
12640  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12641  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12642  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12643  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12644  __Pyx_GOTREF(__pyx_t_1);
12645  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12646  } else
12647  #endif
12648  {
12649  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
12650  __Pyx_GOTREF(__pyx_t_9);
12651  if (__pyx_t_7) {
12652  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12653  }
12654  __Pyx_GIVEREF(__pyx_t_6);
12655  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12656  __Pyx_INCREF(__pyx_v_bytesitem);
12657  __Pyx_GIVEREF(__pyx_v_bytesitem);
12658  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12659  __pyx_t_6 = 0;
12660  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12661  __Pyx_GOTREF(__pyx_t_1);
12662  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12663  }
12664  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12665  __pyx_v_result = __pyx_t_1;
12666  __pyx_t_1 = 0;
12667 
12668  /* "View.MemoryView":492
12669  *
12670  * bytesitem = itemp[:self.view.itemsize]
12671  * try: # <<<<<<<<<<<<<<
12672  * result = struct.unpack(self.view.format, bytesitem)
12673  * except struct.error:
12674  */
12675  }
12676 
12677  /* "View.MemoryView":497
12678  * raise ValueError("Unable to convert item to object")
12679  * else:
12680  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12681  * return result[0]
12682  * return result
12683  */
12684  /*else:*/ {
12685  __pyx_t_10 = strlen(__pyx_v_self->view.format);
12686  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12687  if (__pyx_t_11) {
12688 
12689  /* "View.MemoryView":498
12690  * else:
12691  * if len(self.view.format) == 1:
12692  * return result[0] # <<<<<<<<<<<<<<
12693  * return result
12694  *
12695  */
12696  __Pyx_XDECREF(__pyx_r);
12697  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
12698  __Pyx_GOTREF(__pyx_t_1);
12699  __pyx_r = __pyx_t_1;
12700  __pyx_t_1 = 0;
12701  goto __pyx_L6_except_return;
12702 
12703  /* "View.MemoryView":497
12704  * raise ValueError("Unable to convert item to object")
12705  * else:
12706  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12707  * return result[0]
12708  * return result
12709  */
12710  }
12711 
12712  /* "View.MemoryView":499
12713  * if len(self.view.format) == 1:
12714  * return result[0]
12715  * return result # <<<<<<<<<<<<<<
12716  *
12717  * cdef assign_item_from_object(self, char *itemp, object value):
12718  */
12719  __Pyx_XDECREF(__pyx_r);
12720  __Pyx_INCREF(__pyx_v_result);
12721  __pyx_r = __pyx_v_result;
12722  goto __pyx_L6_except_return;
12723  }
12724  __pyx_L3_error:;
12725  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12726  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12727  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12728  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12729  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12730 
12731  /* "View.MemoryView":494
12732  * try:
12733  * result = struct.unpack(self.view.format, bytesitem)
12734  * except struct.error: # <<<<<<<<<<<<<<
12735  * raise ValueError("Unable to convert item to object")
12736  * else:
12737  */
12738  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12739  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
12740  __Pyx_GOTREF(__pyx_t_6);
12741  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12742  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12743  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12744  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12745  if (__pyx_t_8) {
12746  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12747  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
12748  __Pyx_GOTREF(__pyx_t_9);
12749  __Pyx_GOTREF(__pyx_t_5);
12750  __Pyx_GOTREF(__pyx_t_1);
12751 
12752  /* "View.MemoryView":495
12753  * result = struct.unpack(self.view.format, bytesitem)
12754  * except struct.error:
12755  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
12756  * else:
12757  * if len(self.view.format) == 1:
12758  */
12759  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
12760  __Pyx_GOTREF(__pyx_t_6);
12761  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12762  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12763  __PYX_ERR(1, 495, __pyx_L5_except_error)
12764  }
12765  goto __pyx_L5_except_error;
12766  __pyx_L5_except_error:;
12767 
12768  /* "View.MemoryView":492
12769  *
12770  * bytesitem = itemp[:self.view.itemsize]
12771  * try: # <<<<<<<<<<<<<<
12772  * result = struct.unpack(self.view.format, bytesitem)
12773  * except struct.error:
12774  */
12775  __Pyx_XGIVEREF(__pyx_t_2);
12776  __Pyx_XGIVEREF(__pyx_t_3);
12777  __Pyx_XGIVEREF(__pyx_t_4);
12778  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12779  goto __pyx_L1_error;
12780  __pyx_L6_except_return:;
12781  __Pyx_XGIVEREF(__pyx_t_2);
12782  __Pyx_XGIVEREF(__pyx_t_3);
12783  __Pyx_XGIVEREF(__pyx_t_4);
12784  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12785  goto __pyx_L0;
12786  }
12787 
12788  /* "View.MemoryView":485
12789  * self.assign_item_from_object(itemp, value)
12790  *
12791  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12792  * """Only used if instantiated manually by the user, or if Cython doesn't
12793  * know how to convert the type"""
12794  */
12795 
12796  /* function exit code */
12797  __pyx_L1_error:;
12798  __Pyx_XDECREF(__pyx_t_1);
12799  __Pyx_XDECREF(__pyx_t_5);
12800  __Pyx_XDECREF(__pyx_t_6);
12801  __Pyx_XDECREF(__pyx_t_7);
12802  __Pyx_XDECREF(__pyx_t_9);
12803  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12804  __pyx_r = 0;
12805  __pyx_L0:;
12806  __Pyx_XDECREF(__pyx_v_struct);
12807  __Pyx_XDECREF(__pyx_v_bytesitem);
12808  __Pyx_XDECREF(__pyx_v_result);
12809  __Pyx_XGIVEREF(__pyx_r);
12810  __Pyx_RefNannyFinishContext();
12811  return __pyx_r;
12812 }
12813 
12814 /* "View.MemoryView":501
12815  * return result
12816  *
12817  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12818  * """Only used if instantiated manually by the user, or if Cython doesn't
12819  * know how to convert the type"""
12820  */
12821 
12822 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12823  PyObject *__pyx_v_struct = NULL;
12824  char __pyx_v_c;
12825  PyObject *__pyx_v_bytesvalue = 0;
12826  Py_ssize_t __pyx_v_i;
12827  PyObject *__pyx_r = NULL;
12828  __Pyx_RefNannyDeclarations
12829  PyObject *__pyx_t_1 = NULL;
12830  int __pyx_t_2;
12831  int __pyx_t_3;
12832  PyObject *__pyx_t_4 = NULL;
12833  PyObject *__pyx_t_5 = NULL;
12834  PyObject *__pyx_t_6 = NULL;
12835  int __pyx_t_7;
12836  PyObject *__pyx_t_8 = NULL;
12837  Py_ssize_t __pyx_t_9;
12838  PyObject *__pyx_t_10 = NULL;
12839  char *__pyx_t_11;
12840  char *__pyx_t_12;
12841  char *__pyx_t_13;
12842  char *__pyx_t_14;
12843  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
12844 
12845  /* "View.MemoryView":504
12846  * """Only used if instantiated manually by the user, or if Cython doesn't
12847  * know how to convert the type"""
12848  * import struct # <<<<<<<<<<<<<<
12849  * cdef char c
12850  * cdef bytes bytesvalue
12851  */
12852  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
12853  __Pyx_GOTREF(__pyx_t_1);
12854  __pyx_v_struct = __pyx_t_1;
12855  __pyx_t_1 = 0;
12856 
12857  /* "View.MemoryView":509
12858  * cdef Py_ssize_t i
12859  *
12860  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12861  * bytesvalue = struct.pack(self.view.format, *value)
12862  * else:
12863  */
12864  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12865  __pyx_t_3 = (__pyx_t_2 != 0);
12866  if (__pyx_t_3) {
12867 
12868  /* "View.MemoryView":510
12869  *
12870  * if isinstance(value, tuple):
12871  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
12872  * else:
12873  * bytesvalue = struct.pack(self.view.format, value)
12874  */
12875  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
12876  __Pyx_GOTREF(__pyx_t_1);
12877  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12878  __Pyx_GOTREF(__pyx_t_4);
12879  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
12880  __Pyx_GOTREF(__pyx_t_5);
12881  __Pyx_GIVEREF(__pyx_t_4);
12882  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12883  __pyx_t_4 = 0;
12884  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12885  __Pyx_GOTREF(__pyx_t_4);
12886  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
12887  __Pyx_GOTREF(__pyx_t_6);
12888  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12889  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12890  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12891  __Pyx_GOTREF(__pyx_t_4);
12892  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12893  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12894  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
12895  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12896  __pyx_t_4 = 0;
12897 
12898  /* "View.MemoryView":509
12899  * cdef Py_ssize_t i
12900  *
12901  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12902  * bytesvalue = struct.pack(self.view.format, *value)
12903  * else:
12904  */
12905  goto __pyx_L3;
12906  }
12907 
12908  /* "View.MemoryView":512
12909  * bytesvalue = struct.pack(self.view.format, *value)
12910  * else:
12911  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
12912  *
12913  * for i, c in enumerate(bytesvalue):
12914  */
12915  /*else*/ {
12916  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
12917  __Pyx_GOTREF(__pyx_t_6);
12918  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
12919  __Pyx_GOTREF(__pyx_t_1);
12920  __pyx_t_5 = NULL;
12921  __pyx_t_7 = 0;
12922  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12923  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12924  if (likely(__pyx_t_5)) {
12925  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
12926  __Pyx_INCREF(__pyx_t_5);
12927  __Pyx_INCREF(function);
12928  __Pyx_DECREF_SET(__pyx_t_6, function);
12929  __pyx_t_7 = 1;
12930  }
12931  }
12932  #if CYTHON_FAST_PYCALL
12933  if (PyFunction_Check(__pyx_t_6)) {
12934  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12935  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12936  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12937  __Pyx_GOTREF(__pyx_t_4);
12938  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12939  } else
12940  #endif
12941  #if CYTHON_FAST_PYCCALL
12942  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12943  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12944  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12945  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12946  __Pyx_GOTREF(__pyx_t_4);
12947  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12948  } else
12949  #endif
12950  {
12951  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
12952  __Pyx_GOTREF(__pyx_t_8);
12953  if (__pyx_t_5) {
12954  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12955  }
12956  __Pyx_GIVEREF(__pyx_t_1);
12957  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12958  __Pyx_INCREF(__pyx_v_value);
12959  __Pyx_GIVEREF(__pyx_v_value);
12960  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12961  __pyx_t_1 = 0;
12962  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12963  __Pyx_GOTREF(__pyx_t_4);
12964  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12965  }
12966  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12967  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
12968  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12969  __pyx_t_4 = 0;
12970  }
12971  __pyx_L3:;
12972 
12973  /* "View.MemoryView":514
12974  * bytesvalue = struct.pack(self.view.format, value)
12975  *
12976  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12977  * itemp[i] = c
12978  *
12979  */
12980  __pyx_t_9 = 0;
12981  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12982  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
12983  __PYX_ERR(1, 514, __pyx_L1_error)
12984  }
12985  __Pyx_INCREF(__pyx_v_bytesvalue);
12986  __pyx_t_10 = __pyx_v_bytesvalue;
12987  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12988  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12989  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12990  __pyx_t_11 = __pyx_t_14;
12991  __pyx_v_c = (__pyx_t_11[0]);
12992 
12993  /* "View.MemoryView":515
12994  *
12995  * for i, c in enumerate(bytesvalue):
12996  * itemp[i] = c # <<<<<<<<<<<<<<
12997  *
12998  * @cname('getbuffer')
12999  */
13000  __pyx_v_i = __pyx_t_9;
13001 
13002  /* "View.MemoryView":514
13003  * bytesvalue = struct.pack(self.view.format, value)
13004  *
13005  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
13006  * itemp[i] = c
13007  *
13008  */
13009  __pyx_t_9 = (__pyx_t_9 + 1);
13010 
13011  /* "View.MemoryView":515
13012  *
13013  * for i, c in enumerate(bytesvalue):
13014  * itemp[i] = c # <<<<<<<<<<<<<<
13015  *
13016  * @cname('getbuffer')
13017  */
13018  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
13019  }
13020  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13021 
13022  /* "View.MemoryView":501
13023  * return result
13024  *
13025  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
13026  * """Only used if instantiated manually by the user, or if Cython doesn't
13027  * know how to convert the type"""
13028  */
13029 
13030  /* function exit code */
13031  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13032  goto __pyx_L0;
13033  __pyx_L1_error:;
13034  __Pyx_XDECREF(__pyx_t_1);
13035  __Pyx_XDECREF(__pyx_t_4);
13036  __Pyx_XDECREF(__pyx_t_5);
13037  __Pyx_XDECREF(__pyx_t_6);
13038  __Pyx_XDECREF(__pyx_t_8);
13039  __Pyx_XDECREF(__pyx_t_10);
13040  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13041  __pyx_r = 0;
13042  __pyx_L0:;
13043  __Pyx_XDECREF(__pyx_v_struct);
13044  __Pyx_XDECREF(__pyx_v_bytesvalue);
13045  __Pyx_XGIVEREF(__pyx_r);
13046  __Pyx_RefNannyFinishContext();
13047  return __pyx_r;
13048 }
13049 
13050 /* "View.MemoryView":518
13051  *
13052  * @cname('getbuffer')
13053  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13054  * if flags & PyBUF_WRITABLE and self.view.readonly:
13055  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13056  */
13057 
13058 /* Python wrapper */
13059 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
13060 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13061  int __pyx_r;
13062  __Pyx_RefNannyDeclarations
13063  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
13064  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
13065 
13066  /* function exit code */
13067  __Pyx_RefNannyFinishContext();
13068  return __pyx_r;
13069 }
13070 
13071 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13072  int __pyx_r;
13073  __Pyx_RefNannyDeclarations
13074  int __pyx_t_1;
13075  int __pyx_t_2;
13076  PyObject *__pyx_t_3 = NULL;
13077  Py_ssize_t *__pyx_t_4;
13078  char *__pyx_t_5;
13079  void *__pyx_t_6;
13080  int __pyx_t_7;
13081  Py_ssize_t __pyx_t_8;
13082  if (__pyx_v_info == NULL) {
13083  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
13084  return -1;
13085  }
13086  __Pyx_RefNannySetupContext("__getbuffer__", 0);
13087  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
13088  __Pyx_GIVEREF(__pyx_v_info->obj);
13089 
13090  /* "View.MemoryView":519
13091  * @cname('getbuffer')
13092  * def __getbuffer__(self, Py_buffer *info, int flags):
13093  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13094  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13095  *
13096  */
13097  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
13098  if (__pyx_t_2) {
13099  } else {
13100  __pyx_t_1 = __pyx_t_2;
13101  goto __pyx_L4_bool_binop_done;
13102  }
13103  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
13104  __pyx_t_1 = __pyx_t_2;
13105  __pyx_L4_bool_binop_done:;
13106  if (unlikely(__pyx_t_1)) {
13107 
13108  /* "View.MemoryView":520
13109  * def __getbuffer__(self, Py_buffer *info, int flags):
13110  * if flags & PyBUF_WRITABLE and self.view.readonly:
13111  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
13112  *
13113  * if flags & PyBUF_ND:
13114  */
13115  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
13116  __Pyx_GOTREF(__pyx_t_3);
13117  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13118  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13119  __PYX_ERR(1, 520, __pyx_L1_error)
13120 
13121  /* "View.MemoryView":519
13122  * @cname('getbuffer')
13123  * def __getbuffer__(self, Py_buffer *info, int flags):
13124  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13125  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13126  *
13127  */
13128  }
13129 
13130  /* "View.MemoryView":522
13131  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13132  *
13133  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
13134  * info.shape = self.view.shape
13135  * else:
13136  */
13137  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
13138  if (__pyx_t_1) {
13139 
13140  /* "View.MemoryView":523
13141  *
13142  * if flags & PyBUF_ND:
13143  * info.shape = self.view.shape # <<<<<<<<<<<<<<
13144  * else:
13145  * info.shape = NULL
13146  */
13147  __pyx_t_4 = __pyx_v_self->view.shape;
13148  __pyx_v_info->shape = __pyx_t_4;
13149 
13150  /* "View.MemoryView":522
13151  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13152  *
13153  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
13154  * info.shape = self.view.shape
13155  * else:
13156  */
13157  goto __pyx_L6;
13158  }
13159 
13160  /* "View.MemoryView":525
13161  * info.shape = self.view.shape
13162  * else:
13163  * info.shape = NULL # <<<<<<<<<<<<<<
13164  *
13165  * if flags & PyBUF_STRIDES:
13166  */
13167  /*else*/ {
13168  __pyx_v_info->shape = NULL;
13169  }
13170  __pyx_L6:;
13171 
13172  /* "View.MemoryView":527
13173  * info.shape = NULL
13174  *
13175  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13176  * info.strides = self.view.strides
13177  * else:
13178  */
13179  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13180  if (__pyx_t_1) {
13181 
13182  /* "View.MemoryView":528
13183  *
13184  * if flags & PyBUF_STRIDES:
13185  * info.strides = self.view.strides # <<<<<<<<<<<<<<
13186  * else:
13187  * info.strides = NULL
13188  */
13189  __pyx_t_4 = __pyx_v_self->view.strides;
13190  __pyx_v_info->strides = __pyx_t_4;
13191 
13192  /* "View.MemoryView":527
13193  * info.shape = NULL
13194  *
13195  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13196  * info.strides = self.view.strides
13197  * else:
13198  */
13199  goto __pyx_L7;
13200  }
13201 
13202  /* "View.MemoryView":530
13203  * info.strides = self.view.strides
13204  * else:
13205  * info.strides = NULL # <<<<<<<<<<<<<<
13206  *
13207  * if flags & PyBUF_INDIRECT:
13208  */
13209  /*else*/ {
13210  __pyx_v_info->strides = NULL;
13211  }
13212  __pyx_L7:;
13213 
13214  /* "View.MemoryView":532
13215  * info.strides = NULL
13216  *
13217  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13218  * info.suboffsets = self.view.suboffsets
13219  * else:
13220  */
13221  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
13222  if (__pyx_t_1) {
13223 
13224  /* "View.MemoryView":533
13225  *
13226  * if flags & PyBUF_INDIRECT:
13227  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
13228  * else:
13229  * info.suboffsets = NULL
13230  */
13231  __pyx_t_4 = __pyx_v_self->view.suboffsets;
13232  __pyx_v_info->suboffsets = __pyx_t_4;
13233 
13234  /* "View.MemoryView":532
13235  * info.strides = NULL
13236  *
13237  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13238  * info.suboffsets = self.view.suboffsets
13239  * else:
13240  */
13241  goto __pyx_L8;
13242  }
13243 
13244  /* "View.MemoryView":535
13245  * info.suboffsets = self.view.suboffsets
13246  * else:
13247  * info.suboffsets = NULL # <<<<<<<<<<<<<<
13248  *
13249  * if flags & PyBUF_FORMAT:
13250  */
13251  /*else*/ {
13252  __pyx_v_info->suboffsets = NULL;
13253  }
13254  __pyx_L8:;
13255 
13256  /* "View.MemoryView":537
13257  * info.suboffsets = NULL
13258  *
13259  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13260  * info.format = self.view.format
13261  * else:
13262  */
13263  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
13264  if (__pyx_t_1) {
13265 
13266  /* "View.MemoryView":538
13267  *
13268  * if flags & PyBUF_FORMAT:
13269  * info.format = self.view.format # <<<<<<<<<<<<<<
13270  * else:
13271  * info.format = NULL
13272  */
13273  __pyx_t_5 = __pyx_v_self->view.format;
13274  __pyx_v_info->format = __pyx_t_5;
13275 
13276  /* "View.MemoryView":537
13277  * info.suboffsets = NULL
13278  *
13279  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13280  * info.format = self.view.format
13281  * else:
13282  */
13283  goto __pyx_L9;
13284  }
13285 
13286  /* "View.MemoryView":540
13287  * info.format = self.view.format
13288  * else:
13289  * info.format = NULL # <<<<<<<<<<<<<<
13290  *
13291  * info.buf = self.view.buf
13292  */
13293  /*else*/ {
13294  __pyx_v_info->format = NULL;
13295  }
13296  __pyx_L9:;
13297 
13298  /* "View.MemoryView":542
13299  * info.format = NULL
13300  *
13301  * info.buf = self.view.buf # <<<<<<<<<<<<<<
13302  * info.ndim = self.view.ndim
13303  * info.itemsize = self.view.itemsize
13304  */
13305  __pyx_t_6 = __pyx_v_self->view.buf;
13306  __pyx_v_info->buf = __pyx_t_6;
13307 
13308  /* "View.MemoryView":543
13309  *
13310  * info.buf = self.view.buf
13311  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
13312  * info.itemsize = self.view.itemsize
13313  * info.len = self.view.len
13314  */
13315  __pyx_t_7 = __pyx_v_self->view.ndim;
13316  __pyx_v_info->ndim = __pyx_t_7;
13317 
13318  /* "View.MemoryView":544
13319  * info.buf = self.view.buf
13320  * info.ndim = self.view.ndim
13321  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
13322  * info.len = self.view.len
13323  * info.readonly = self.view.readonly
13324  */
13325  __pyx_t_8 = __pyx_v_self->view.itemsize;
13326  __pyx_v_info->itemsize = __pyx_t_8;
13327 
13328  /* "View.MemoryView":545
13329  * info.ndim = self.view.ndim
13330  * info.itemsize = self.view.itemsize
13331  * info.len = self.view.len # <<<<<<<<<<<<<<
13332  * info.readonly = self.view.readonly
13333  * info.obj = self
13334  */
13335  __pyx_t_8 = __pyx_v_self->view.len;
13336  __pyx_v_info->len = __pyx_t_8;
13337 
13338  /* "View.MemoryView":546
13339  * info.itemsize = self.view.itemsize
13340  * info.len = self.view.len
13341  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
13342  * info.obj = self
13343  *
13344  */
13345  __pyx_t_1 = __pyx_v_self->view.readonly;
13346  __pyx_v_info->readonly = __pyx_t_1;
13347 
13348  /* "View.MemoryView":547
13349  * info.len = self.view.len
13350  * info.readonly = self.view.readonly
13351  * info.obj = self # <<<<<<<<<<<<<<
13352  *
13353  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
13354  */
13355  __Pyx_INCREF(((PyObject *)__pyx_v_self));
13356  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13357  __Pyx_GOTREF(__pyx_v_info->obj);
13358  __Pyx_DECREF(__pyx_v_info->obj);
13359  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13360 
13361  /* "View.MemoryView":518
13362  *
13363  * @cname('getbuffer')
13364  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13365  * if flags & PyBUF_WRITABLE and self.view.readonly:
13366  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13367  */
13368 
13369  /* function exit code */
13370  __pyx_r = 0;
13371  goto __pyx_L0;
13372  __pyx_L1_error:;
13373  __Pyx_XDECREF(__pyx_t_3);
13374  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13375  __pyx_r = -1;
13376  if (__pyx_v_info->obj != NULL) {
13377  __Pyx_GOTREF(__pyx_v_info->obj);
13378  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13379  }
13380  goto __pyx_L2;
13381  __pyx_L0:;
13382  if (__pyx_v_info->obj == Py_None) {
13383  __Pyx_GOTREF(__pyx_v_info->obj);
13384  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13385  }
13386  __pyx_L2:;
13387  __Pyx_RefNannyFinishContext();
13388  return __pyx_r;
13389 }
13390 
13391 /* "View.MemoryView":553
13392  *
13393  * @property
13394  * def T(self): # <<<<<<<<<<<<<<
13395  * cdef _memoryviewslice result = memoryview_copy(self)
13396  * transpose_memslice(&result.from_slice)
13397  */
13398 
13399 /* Python wrapper */
13400 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
13401 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13402  PyObject *__pyx_r = 0;
13403  __Pyx_RefNannyDeclarations
13404  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13405  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13406 
13407  /* function exit code */
13408  __Pyx_RefNannyFinishContext();
13409  return __pyx_r;
13410 }
13411 
13412 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13413  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13414  PyObject *__pyx_r = NULL;
13415  __Pyx_RefNannyDeclarations
13416  PyObject *__pyx_t_1 = NULL;
13417  int __pyx_t_2;
13418  __Pyx_RefNannySetupContext("__get__", 0);
13419 
13420  /* "View.MemoryView":554
13421  * @property
13422  * def T(self):
13423  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
13424  * transpose_memslice(&result.from_slice)
13425  * return result
13426  */
13427  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
13428  __Pyx_GOTREF(__pyx_t_1);
13429  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
13430  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13431  __pyx_t_1 = 0;
13432 
13433  /* "View.MemoryView":555
13434  * def T(self):
13435  * cdef _memoryviewslice result = memoryview_copy(self)
13436  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
13437  * return result
13438  *
13439  */
13440  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
13441 
13442  /* "View.MemoryView":556
13443  * cdef _memoryviewslice result = memoryview_copy(self)
13444  * transpose_memslice(&result.from_slice)
13445  * return result # <<<<<<<<<<<<<<
13446  *
13447  * @property
13448  */
13449  __Pyx_XDECREF(__pyx_r);
13450  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13451  __pyx_r = ((PyObject *)__pyx_v_result);
13452  goto __pyx_L0;
13453 
13454  /* "View.MemoryView":553
13455  *
13456  * @property
13457  * def T(self): # <<<<<<<<<<<<<<
13458  * cdef _memoryviewslice result = memoryview_copy(self)
13459  * transpose_memslice(&result.from_slice)
13460  */
13461 
13462  /* function exit code */
13463  __pyx_L1_error:;
13464  __Pyx_XDECREF(__pyx_t_1);
13465  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13466  __pyx_r = NULL;
13467  __pyx_L0:;
13468  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13469  __Pyx_XGIVEREF(__pyx_r);
13470  __Pyx_RefNannyFinishContext();
13471  return __pyx_r;
13472 }
13473 
13474 /* "View.MemoryView":559
13475  *
13476  * @property
13477  * def base(self): # <<<<<<<<<<<<<<
13478  * return self.obj
13479  *
13480  */
13481 
13482 /* Python wrapper */
13483 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
13484 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13485  PyObject *__pyx_r = 0;
13486  __Pyx_RefNannyDeclarations
13487  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13488  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13489 
13490  /* function exit code */
13491  __Pyx_RefNannyFinishContext();
13492  return __pyx_r;
13493 }
13494 
13495 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13496  PyObject *__pyx_r = NULL;
13497  __Pyx_RefNannyDeclarations
13498  __Pyx_RefNannySetupContext("__get__", 0);
13499 
13500  /* "View.MemoryView":560
13501  * @property
13502  * def base(self):
13503  * return self.obj # <<<<<<<<<<<<<<
13504  *
13505  * @property
13506  */
13507  __Pyx_XDECREF(__pyx_r);
13508  __Pyx_INCREF(__pyx_v_self->obj);
13509  __pyx_r = __pyx_v_self->obj;
13510  goto __pyx_L0;
13511 
13512  /* "View.MemoryView":559
13513  *
13514  * @property
13515  * def base(self): # <<<<<<<<<<<<<<
13516  * return self.obj
13517  *
13518  */
13519 
13520  /* function exit code */
13521  __pyx_L0:;
13522  __Pyx_XGIVEREF(__pyx_r);
13523  __Pyx_RefNannyFinishContext();
13524  return __pyx_r;
13525 }
13526 
13527 /* "View.MemoryView":563
13528  *
13529  * @property
13530  * def shape(self): # <<<<<<<<<<<<<<
13531  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13532  *
13533  */
13534 
13535 /* Python wrapper */
13536 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
13537 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13538  PyObject *__pyx_r = 0;
13539  __Pyx_RefNannyDeclarations
13540  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13541  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13542 
13543  /* function exit code */
13544  __Pyx_RefNannyFinishContext();
13545  return __pyx_r;
13546 }
13547 
13548 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13549  Py_ssize_t __pyx_v_length;
13550  PyObject *__pyx_r = NULL;
13551  __Pyx_RefNannyDeclarations
13552  PyObject *__pyx_t_1 = NULL;
13553  Py_ssize_t *__pyx_t_2;
13554  Py_ssize_t *__pyx_t_3;
13555  Py_ssize_t *__pyx_t_4;
13556  PyObject *__pyx_t_5 = NULL;
13557  __Pyx_RefNannySetupContext("__get__", 0);
13558 
13559  /* "View.MemoryView":564
13560  * @property
13561  * def shape(self):
13562  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
13563  *
13564  * @property
13565  */
13566  __Pyx_XDECREF(__pyx_r);
13567  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
13568  __Pyx_GOTREF(__pyx_t_1);
13569  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13570  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13571  __pyx_t_2 = __pyx_t_4;
13572  __pyx_v_length = (__pyx_t_2[0]);
13573  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13574  __Pyx_GOTREF(__pyx_t_5);
13575  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
13576  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13577  }
13578  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13579  __Pyx_GOTREF(__pyx_t_5);
13580  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13581  __pyx_r = __pyx_t_5;
13582  __pyx_t_5 = 0;
13583  goto __pyx_L0;
13584 
13585  /* "View.MemoryView":563
13586  *
13587  * @property
13588  * def shape(self): # <<<<<<<<<<<<<<
13589  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13590  *
13591  */
13592 
13593  /* function exit code */
13594  __pyx_L1_error:;
13595  __Pyx_XDECREF(__pyx_t_1);
13596  __Pyx_XDECREF(__pyx_t_5);
13597  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13598  __pyx_r = NULL;
13599  __pyx_L0:;
13600  __Pyx_XGIVEREF(__pyx_r);
13601  __Pyx_RefNannyFinishContext();
13602  return __pyx_r;
13603 }
13604 
13605 /* "View.MemoryView":567
13606  *
13607  * @property
13608  * def strides(self): # <<<<<<<<<<<<<<
13609  * if self.view.strides == NULL:
13610  *
13611  */
13612 
13613 /* Python wrapper */
13614 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
13615 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13616  PyObject *__pyx_r = 0;
13617  __Pyx_RefNannyDeclarations
13618  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13619  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13620 
13621  /* function exit code */
13622  __Pyx_RefNannyFinishContext();
13623  return __pyx_r;
13624 }
13625 
13626 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13627  Py_ssize_t __pyx_v_stride;
13628  PyObject *__pyx_r = NULL;
13629  __Pyx_RefNannyDeclarations
13630  int __pyx_t_1;
13631  PyObject *__pyx_t_2 = NULL;
13632  Py_ssize_t *__pyx_t_3;
13633  Py_ssize_t *__pyx_t_4;
13634  Py_ssize_t *__pyx_t_5;
13635  PyObject *__pyx_t_6 = NULL;
13636  __Pyx_RefNannySetupContext("__get__", 0);
13637 
13638  /* "View.MemoryView":568
13639  * @property
13640  * def strides(self):
13641  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13642  *
13643  * raise ValueError("Buffer view does not expose strides")
13644  */
13645  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13646  if (unlikely(__pyx_t_1)) {
13647 
13648  /* "View.MemoryView":570
13649  * if self.view.strides == NULL:
13650  *
13651  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
13652  *
13653  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
13654  */
13655  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
13656  __Pyx_GOTREF(__pyx_t_2);
13657  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13658  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13659  __PYX_ERR(1, 570, __pyx_L1_error)
13660 
13661  /* "View.MemoryView":568
13662  * @property
13663  * def strides(self):
13664  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13665  *
13666  * raise ValueError("Buffer view does not expose strides")
13667  */
13668  }
13669 
13670  /* "View.MemoryView":572
13671  * raise ValueError("Buffer view does not expose strides")
13672  *
13673  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
13674  *
13675  * @property
13676  */
13677  __Pyx_XDECREF(__pyx_r);
13678  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
13679  __Pyx_GOTREF(__pyx_t_2);
13680  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13681  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13682  __pyx_t_3 = __pyx_t_5;
13683  __pyx_v_stride = (__pyx_t_3[0]);
13684  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13685  __Pyx_GOTREF(__pyx_t_6);
13686  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
13687  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13688  }
13689  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13690  __Pyx_GOTREF(__pyx_t_6);
13691  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13692  __pyx_r = __pyx_t_6;
13693  __pyx_t_6 = 0;
13694  goto __pyx_L0;
13695 
13696  /* "View.MemoryView":567
13697  *
13698  * @property
13699  * def strides(self): # <<<<<<<<<<<<<<
13700  * if self.view.strides == NULL:
13701  *
13702  */
13703 
13704  /* function exit code */
13705  __pyx_L1_error:;
13706  __Pyx_XDECREF(__pyx_t_2);
13707  __Pyx_XDECREF(__pyx_t_6);
13708  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13709  __pyx_r = NULL;
13710  __pyx_L0:;
13711  __Pyx_XGIVEREF(__pyx_r);
13712  __Pyx_RefNannyFinishContext();
13713  return __pyx_r;
13714 }
13715 
13716 /* "View.MemoryView":575
13717  *
13718  * @property
13719  * def suboffsets(self): # <<<<<<<<<<<<<<
13720  * if self.view.suboffsets == NULL:
13721  * return (-1,) * self.view.ndim
13722  */
13723 
13724 /* Python wrapper */
13725 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
13726 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13727  PyObject *__pyx_r = 0;
13728  __Pyx_RefNannyDeclarations
13729  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13730  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13731 
13732  /* function exit code */
13733  __Pyx_RefNannyFinishContext();
13734  return __pyx_r;
13735 }
13736 
13737 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13738  Py_ssize_t __pyx_v_suboffset;
13739  PyObject *__pyx_r = NULL;
13740  __Pyx_RefNannyDeclarations
13741  int __pyx_t_1;
13742  PyObject *__pyx_t_2 = NULL;
13743  PyObject *__pyx_t_3 = NULL;
13744  Py_ssize_t *__pyx_t_4;
13745  Py_ssize_t *__pyx_t_5;
13746  Py_ssize_t *__pyx_t_6;
13747  __Pyx_RefNannySetupContext("__get__", 0);
13748 
13749  /* "View.MemoryView":576
13750  * @property
13751  * def suboffsets(self):
13752  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13753  * return (-1,) * self.view.ndim
13754  *
13755  */
13756  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13757  if (__pyx_t_1) {
13758 
13759  /* "View.MemoryView":577
13760  * def suboffsets(self):
13761  * if self.view.suboffsets == NULL:
13762  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
13763  *
13764  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
13765  */
13766  __Pyx_XDECREF(__pyx_r);
13767  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
13768  __Pyx_GOTREF(__pyx_t_2);
13769  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__24, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
13770  __Pyx_GOTREF(__pyx_t_3);
13771  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13772  __pyx_r = __pyx_t_3;
13773  __pyx_t_3 = 0;
13774  goto __pyx_L0;
13775 
13776  /* "View.MemoryView":576
13777  * @property
13778  * def suboffsets(self):
13779  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13780  * return (-1,) * self.view.ndim
13781  *
13782  */
13783  }
13784 
13785  /* "View.MemoryView":579
13786  * return (-1,) * self.view.ndim
13787  *
13788  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
13789  *
13790  * @property
13791  */
13792  __Pyx_XDECREF(__pyx_r);
13793  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
13794  __Pyx_GOTREF(__pyx_t_3);
13795  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13796  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13797  __pyx_t_4 = __pyx_t_6;
13798  __pyx_v_suboffset = (__pyx_t_4[0]);
13799  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13800  __Pyx_GOTREF(__pyx_t_2);
13801  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
13802  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13803  }
13804  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13805  __Pyx_GOTREF(__pyx_t_2);
13806  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13807  __pyx_r = __pyx_t_2;
13808  __pyx_t_2 = 0;
13809  goto __pyx_L0;
13810 
13811  /* "View.MemoryView":575
13812  *
13813  * @property
13814  * def suboffsets(self): # <<<<<<<<<<<<<<
13815  * if self.view.suboffsets == NULL:
13816  * return (-1,) * self.view.ndim
13817  */
13818 
13819  /* function exit code */
13820  __pyx_L1_error:;
13821  __Pyx_XDECREF(__pyx_t_2);
13822  __Pyx_XDECREF(__pyx_t_3);
13823  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13824  __pyx_r = NULL;
13825  __pyx_L0:;
13826  __Pyx_XGIVEREF(__pyx_r);
13827  __Pyx_RefNannyFinishContext();
13828  return __pyx_r;
13829 }
13830 
13831 /* "View.MemoryView":582
13832  *
13833  * @property
13834  * def ndim(self): # <<<<<<<<<<<<<<
13835  * return self.view.ndim
13836  *
13837  */
13838 
13839 /* Python wrapper */
13840 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
13841 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13842  PyObject *__pyx_r = 0;
13843  __Pyx_RefNannyDeclarations
13844  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13845  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13846 
13847  /* function exit code */
13848  __Pyx_RefNannyFinishContext();
13849  return __pyx_r;
13850 }
13851 
13852 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13853  PyObject *__pyx_r = NULL;
13854  __Pyx_RefNannyDeclarations
13855  PyObject *__pyx_t_1 = NULL;
13856  __Pyx_RefNannySetupContext("__get__", 0);
13857 
13858  /* "View.MemoryView":583
13859  * @property
13860  * def ndim(self):
13861  * return self.view.ndim # <<<<<<<<<<<<<<
13862  *
13863  * @property
13864  */
13865  __Pyx_XDECREF(__pyx_r);
13866  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
13867  __Pyx_GOTREF(__pyx_t_1);
13868  __pyx_r = __pyx_t_1;
13869  __pyx_t_1 = 0;
13870  goto __pyx_L0;
13871 
13872  /* "View.MemoryView":582
13873  *
13874  * @property
13875  * def ndim(self): # <<<<<<<<<<<<<<
13876  * return self.view.ndim
13877  *
13878  */
13879 
13880  /* function exit code */
13881  __pyx_L1_error:;
13882  __Pyx_XDECREF(__pyx_t_1);
13883  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13884  __pyx_r = NULL;
13885  __pyx_L0:;
13886  __Pyx_XGIVEREF(__pyx_r);
13887  __Pyx_RefNannyFinishContext();
13888  return __pyx_r;
13889 }
13890 
13891 /* "View.MemoryView":586
13892  *
13893  * @property
13894  * def itemsize(self): # <<<<<<<<<<<<<<
13895  * return self.view.itemsize
13896  *
13897  */
13898 
13899 /* Python wrapper */
13900 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
13901 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13902  PyObject *__pyx_r = 0;
13903  __Pyx_RefNannyDeclarations
13904  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13905  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13906 
13907  /* function exit code */
13908  __Pyx_RefNannyFinishContext();
13909  return __pyx_r;
13910 }
13911 
13912 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13913  PyObject *__pyx_r = NULL;
13914  __Pyx_RefNannyDeclarations
13915  PyObject *__pyx_t_1 = NULL;
13916  __Pyx_RefNannySetupContext("__get__", 0);
13917 
13918  /* "View.MemoryView":587
13919  * @property
13920  * def itemsize(self):
13921  * return self.view.itemsize # <<<<<<<<<<<<<<
13922  *
13923  * @property
13924  */
13925  __Pyx_XDECREF(__pyx_r);
13926  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
13927  __Pyx_GOTREF(__pyx_t_1);
13928  __pyx_r = __pyx_t_1;
13929  __pyx_t_1 = 0;
13930  goto __pyx_L0;
13931 
13932  /* "View.MemoryView":586
13933  *
13934  * @property
13935  * def itemsize(self): # <<<<<<<<<<<<<<
13936  * return self.view.itemsize
13937  *
13938  */
13939 
13940  /* function exit code */
13941  __pyx_L1_error:;
13942  __Pyx_XDECREF(__pyx_t_1);
13943  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13944  __pyx_r = NULL;
13945  __pyx_L0:;
13946  __Pyx_XGIVEREF(__pyx_r);
13947  __Pyx_RefNannyFinishContext();
13948  return __pyx_r;
13949 }
13950 
13951 /* "View.MemoryView":590
13952  *
13953  * @property
13954  * def nbytes(self): # <<<<<<<<<<<<<<
13955  * return self.size * self.view.itemsize
13956  *
13957  */
13958 
13959 /* Python wrapper */
13960 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
13961 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13962  PyObject *__pyx_r = 0;
13963  __Pyx_RefNannyDeclarations
13964  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13965  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13966 
13967  /* function exit code */
13968  __Pyx_RefNannyFinishContext();
13969  return __pyx_r;
13970 }
13971 
13972 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13973  PyObject *__pyx_r = NULL;
13974  __Pyx_RefNannyDeclarations
13975  PyObject *__pyx_t_1 = NULL;
13976  PyObject *__pyx_t_2 = NULL;
13977  PyObject *__pyx_t_3 = NULL;
13978  __Pyx_RefNannySetupContext("__get__", 0);
13979 
13980  /* "View.MemoryView":591
13981  * @property
13982  * def nbytes(self):
13983  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
13984  *
13985  * @property
13986  */
13987  __Pyx_XDECREF(__pyx_r);
13988  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
13989  __Pyx_GOTREF(__pyx_t_1);
13990  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
13991  __Pyx_GOTREF(__pyx_t_2);
13992  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
13993  __Pyx_GOTREF(__pyx_t_3);
13994  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13995  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13996  __pyx_r = __pyx_t_3;
13997  __pyx_t_3 = 0;
13998  goto __pyx_L0;
13999 
14000  /* "View.MemoryView":590
14001  *
14002  * @property
14003  * def nbytes(self): # <<<<<<<<<<<<<<
14004  * return self.size * self.view.itemsize
14005  *
14006  */
14007 
14008  /* function exit code */
14009  __pyx_L1_error:;
14010  __Pyx_XDECREF(__pyx_t_1);
14011  __Pyx_XDECREF(__pyx_t_2);
14012  __Pyx_XDECREF(__pyx_t_3);
14013  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14014  __pyx_r = NULL;
14015  __pyx_L0:;
14016  __Pyx_XGIVEREF(__pyx_r);
14017  __Pyx_RefNannyFinishContext();
14018  return __pyx_r;
14019 }
14020 
14021 /* "View.MemoryView":594
14022  *
14023  * @property
14024  * def size(self): # <<<<<<<<<<<<<<
14025  * if self._size is None:
14026  * result = 1
14027  */
14028 
14029 /* Python wrapper */
14030 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
14031 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
14032  PyObject *__pyx_r = 0;
14033  __Pyx_RefNannyDeclarations
14034  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14035  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14036 
14037  /* function exit code */
14038  __Pyx_RefNannyFinishContext();
14039  return __pyx_r;
14040 }
14041 
14042 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14043  PyObject *__pyx_v_result = NULL;
14044  PyObject *__pyx_v_length = NULL;
14045  PyObject *__pyx_r = NULL;
14046  __Pyx_RefNannyDeclarations
14047  int __pyx_t_1;
14048  int __pyx_t_2;
14049  Py_ssize_t *__pyx_t_3;
14050  Py_ssize_t *__pyx_t_4;
14051  Py_ssize_t *__pyx_t_5;
14052  PyObject *__pyx_t_6 = NULL;
14053  __Pyx_RefNannySetupContext("__get__", 0);
14054 
14055  /* "View.MemoryView":595
14056  * @property
14057  * def size(self):
14058  * if self._size is None: # <<<<<<<<<<<<<<
14059  * result = 1
14060  *
14061  */
14062  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
14063  __pyx_t_2 = (__pyx_t_1 != 0);
14064  if (__pyx_t_2) {
14065 
14066  /* "View.MemoryView":596
14067  * def size(self):
14068  * if self._size is None:
14069  * result = 1 # <<<<<<<<<<<<<<
14070  *
14071  * for length in self.view.shape[:self.view.ndim]:
14072  */
14073  __Pyx_INCREF(__pyx_int_1);
14074  __pyx_v_result = __pyx_int_1;
14075 
14076  /* "View.MemoryView":598
14077  * result = 1
14078  *
14079  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
14080  * result *= length
14081  *
14082  */
14083  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14084  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14085  __pyx_t_3 = __pyx_t_5;
14086  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
14087  __Pyx_GOTREF(__pyx_t_6);
14088  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
14089  __pyx_t_6 = 0;
14090 
14091  /* "View.MemoryView":599
14092  *
14093  * for length in self.view.shape[:self.view.ndim]:
14094  * result *= length # <<<<<<<<<<<<<<
14095  *
14096  * self._size = result
14097  */
14098  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
14099  __Pyx_GOTREF(__pyx_t_6);
14100  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
14101  __pyx_t_6 = 0;
14102  }
14103 
14104  /* "View.MemoryView":601
14105  * result *= length
14106  *
14107  * self._size = result # <<<<<<<<<<<<<<
14108  *
14109  * return self._size
14110  */
14111  __Pyx_INCREF(__pyx_v_result);
14112  __Pyx_GIVEREF(__pyx_v_result);
14113  __Pyx_GOTREF(__pyx_v_self->_size);
14114  __Pyx_DECREF(__pyx_v_self->_size);
14115  __pyx_v_self->_size = __pyx_v_result;
14116 
14117  /* "View.MemoryView":595
14118  * @property
14119  * def size(self):
14120  * if self._size is None: # <<<<<<<<<<<<<<
14121  * result = 1
14122  *
14123  */
14124  }
14125 
14126  /* "View.MemoryView":603
14127  * self._size = result
14128  *
14129  * return self._size # <<<<<<<<<<<<<<
14130  *
14131  * def __len__(self):
14132  */
14133  __Pyx_XDECREF(__pyx_r);
14134  __Pyx_INCREF(__pyx_v_self->_size);
14135  __pyx_r = __pyx_v_self->_size;
14136  goto __pyx_L0;
14137 
14138  /* "View.MemoryView":594
14139  *
14140  * @property
14141  * def size(self): # <<<<<<<<<<<<<<
14142  * if self._size is None:
14143  * result = 1
14144  */
14145 
14146  /* function exit code */
14147  __pyx_L1_error:;
14148  __Pyx_XDECREF(__pyx_t_6);
14149  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14150  __pyx_r = NULL;
14151  __pyx_L0:;
14152  __Pyx_XDECREF(__pyx_v_result);
14153  __Pyx_XDECREF(__pyx_v_length);
14154  __Pyx_XGIVEREF(__pyx_r);
14155  __Pyx_RefNannyFinishContext();
14156  return __pyx_r;
14157 }
14158 
14159 /* "View.MemoryView":605
14160  * return self._size
14161  *
14162  * def __len__(self): # <<<<<<<<<<<<<<
14163  * if self.view.ndim >= 1:
14164  * return self.view.shape[0]
14165  */
14166 
14167 /* Python wrapper */
14168 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
14169 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
14170  Py_ssize_t __pyx_r;
14171  __Pyx_RefNannyDeclarations
14172  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
14173  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14174 
14175  /* function exit code */
14176  __Pyx_RefNannyFinishContext();
14177  return __pyx_r;
14178 }
14179 
14180 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
14181  Py_ssize_t __pyx_r;
14182  __Pyx_RefNannyDeclarations
14183  int __pyx_t_1;
14184  __Pyx_RefNannySetupContext("__len__", 0);
14185 
14186  /* "View.MemoryView":606
14187  *
14188  * def __len__(self):
14189  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14190  * return self.view.shape[0]
14191  *
14192  */
14193  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
14194  if (__pyx_t_1) {
14195 
14196  /* "View.MemoryView":607
14197  * def __len__(self):
14198  * if self.view.ndim >= 1:
14199  * return self.view.shape[0] # <<<<<<<<<<<<<<
14200  *
14201  * return 0
14202  */
14203  __pyx_r = (__pyx_v_self->view.shape[0]);
14204  goto __pyx_L0;
14205 
14206  /* "View.MemoryView":606
14207  *
14208  * def __len__(self):
14209  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14210  * return self.view.shape[0]
14211  *
14212  */
14213  }
14214 
14215  /* "View.MemoryView":609
14216  * return self.view.shape[0]
14217  *
14218  * return 0 # <<<<<<<<<<<<<<
14219  *
14220  * def __repr__(self):
14221  */
14222  __pyx_r = 0;
14223  goto __pyx_L0;
14224 
14225  /* "View.MemoryView":605
14226  * return self._size
14227  *
14228  * def __len__(self): # <<<<<<<<<<<<<<
14229  * if self.view.ndim >= 1:
14230  * return self.view.shape[0]
14231  */
14232 
14233  /* function exit code */
14234  __pyx_L0:;
14235  __Pyx_RefNannyFinishContext();
14236  return __pyx_r;
14237 }
14238 
14239 /* "View.MemoryView":611
14240  * return 0
14241  *
14242  * def __repr__(self): # <<<<<<<<<<<<<<
14243  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14244  * id(self))
14245  */
14246 
14247 /* Python wrapper */
14248 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
14249 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
14250  PyObject *__pyx_r = 0;
14251  __Pyx_RefNannyDeclarations
14252  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
14253  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14254 
14255  /* function exit code */
14256  __Pyx_RefNannyFinishContext();
14257  return __pyx_r;
14258 }
14259 
14260 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
14261  PyObject *__pyx_r = NULL;
14262  __Pyx_RefNannyDeclarations
14263  PyObject *__pyx_t_1 = NULL;
14264  PyObject *__pyx_t_2 = NULL;
14265  PyObject *__pyx_t_3 = NULL;
14266  __Pyx_RefNannySetupContext("__repr__", 0);
14267 
14268  /* "View.MemoryView":612
14269  *
14270  * def __repr__(self):
14271  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14272  * id(self))
14273  *
14274  */
14275  __Pyx_XDECREF(__pyx_r);
14276  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
14277  __Pyx_GOTREF(__pyx_t_1);
14278  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
14279  __Pyx_GOTREF(__pyx_t_2);
14280  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14281  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
14282  __Pyx_GOTREF(__pyx_t_1);
14283  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14284 
14285  /* "View.MemoryView":613
14286  * def __repr__(self):
14287  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14288  * id(self)) # <<<<<<<<<<<<<<
14289  *
14290  * def __str__(self):
14291  */
14292  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
14293  __Pyx_GOTREF(__pyx_t_2);
14294 
14295  /* "View.MemoryView":612
14296  *
14297  * def __repr__(self):
14298  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14299  * id(self))
14300  *
14301  */
14302  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
14303  __Pyx_GOTREF(__pyx_t_3);
14304  __Pyx_GIVEREF(__pyx_t_1);
14305  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14306  __Pyx_GIVEREF(__pyx_t_2);
14307  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14308  __pyx_t_1 = 0;
14309  __pyx_t_2 = 0;
14310  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
14311  __Pyx_GOTREF(__pyx_t_2);
14312  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14313  __pyx_r = __pyx_t_2;
14314  __pyx_t_2 = 0;
14315  goto __pyx_L0;
14316 
14317  /* "View.MemoryView":611
14318  * return 0
14319  *
14320  * def __repr__(self): # <<<<<<<<<<<<<<
14321  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14322  * id(self))
14323  */
14324 
14325  /* function exit code */
14326  __pyx_L1_error:;
14327  __Pyx_XDECREF(__pyx_t_1);
14328  __Pyx_XDECREF(__pyx_t_2);
14329  __Pyx_XDECREF(__pyx_t_3);
14330  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14331  __pyx_r = NULL;
14332  __pyx_L0:;
14333  __Pyx_XGIVEREF(__pyx_r);
14334  __Pyx_RefNannyFinishContext();
14335  return __pyx_r;
14336 }
14337 
14338 /* "View.MemoryView":615
14339  * id(self))
14340  *
14341  * def __str__(self): # <<<<<<<<<<<<<<
14342  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14343  *
14344  */
14345 
14346 /* Python wrapper */
14347 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
14348 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14349  PyObject *__pyx_r = 0;
14350  __Pyx_RefNannyDeclarations
14351  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
14352  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14353 
14354  /* function exit code */
14355  __Pyx_RefNannyFinishContext();
14356  return __pyx_r;
14357 }
14358 
14359 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
14360  PyObject *__pyx_r = NULL;
14361  __Pyx_RefNannyDeclarations
14362  PyObject *__pyx_t_1 = NULL;
14363  PyObject *__pyx_t_2 = NULL;
14364  __Pyx_RefNannySetupContext("__str__", 0);
14365 
14366  /* "View.MemoryView":616
14367  *
14368  * def __str__(self):
14369  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
14370  *
14371  *
14372  */
14373  __Pyx_XDECREF(__pyx_r);
14374  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14375  __Pyx_GOTREF(__pyx_t_1);
14376  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
14377  __Pyx_GOTREF(__pyx_t_2);
14378  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14379  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14380  __Pyx_GOTREF(__pyx_t_1);
14381  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14382  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
14383  __Pyx_GOTREF(__pyx_t_2);
14384  __Pyx_GIVEREF(__pyx_t_1);
14385  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14386  __pyx_t_1 = 0;
14387  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14388  __Pyx_GOTREF(__pyx_t_1);
14389  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14390  __pyx_r = __pyx_t_1;
14391  __pyx_t_1 = 0;
14392  goto __pyx_L0;
14393 
14394  /* "View.MemoryView":615
14395  * id(self))
14396  *
14397  * def __str__(self): # <<<<<<<<<<<<<<
14398  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14399  *
14400  */
14401 
14402  /* function exit code */
14403  __pyx_L1_error:;
14404  __Pyx_XDECREF(__pyx_t_1);
14405  __Pyx_XDECREF(__pyx_t_2);
14406  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14407  __pyx_r = NULL;
14408  __pyx_L0:;
14409  __Pyx_XGIVEREF(__pyx_r);
14410  __Pyx_RefNannyFinishContext();
14411  return __pyx_r;
14412 }
14413 
14414 /* "View.MemoryView":619
14415  *
14416  *
14417  * def is_c_contig(self): # <<<<<<<<<<<<<<
14418  * cdef __Pyx_memviewslice *mslice
14419  * cdef __Pyx_memviewslice tmp
14420  */
14421 
14422 /* Python wrapper */
14423 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14424 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14425  PyObject *__pyx_r = 0;
14426  __Pyx_RefNannyDeclarations
14427  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
14428  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14429 
14430  /* function exit code */
14431  __Pyx_RefNannyFinishContext();
14432  return __pyx_r;
14433 }
14434 
14435 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14436  __Pyx_memviewslice *__pyx_v_mslice;
14437  __Pyx_memviewslice __pyx_v_tmp;
14438  PyObject *__pyx_r = NULL;
14439  __Pyx_RefNannyDeclarations
14440  __Pyx_memviewslice *__pyx_t_1;
14441  PyObject *__pyx_t_2 = NULL;
14442  __Pyx_RefNannySetupContext("is_c_contig", 0);
14443 
14444  /* "View.MemoryView":622
14445  * cdef __Pyx_memviewslice *mslice
14446  * cdef __Pyx_memviewslice tmp
14447  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14448  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14449  *
14450  */
14451  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
14452  __pyx_v_mslice = __pyx_t_1;
14453 
14454  /* "View.MemoryView":623
14455  * cdef __Pyx_memviewslice tmp
14456  * mslice = get_slice_from_memview(self, &tmp)
14457  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
14458  *
14459  * def is_f_contig(self):
14460  */
14461  __Pyx_XDECREF(__pyx_r);
14462  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
14463  __Pyx_GOTREF(__pyx_t_2);
14464  __pyx_r = __pyx_t_2;
14465  __pyx_t_2 = 0;
14466  goto __pyx_L0;
14467 
14468  /* "View.MemoryView":619
14469  *
14470  *
14471  * def is_c_contig(self): # <<<<<<<<<<<<<<
14472  * cdef __Pyx_memviewslice *mslice
14473  * cdef __Pyx_memviewslice tmp
14474  */
14475 
14476  /* function exit code */
14477  __pyx_L1_error:;
14478  __Pyx_XDECREF(__pyx_t_2);
14479  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14480  __pyx_r = NULL;
14481  __pyx_L0:;
14482  __Pyx_XGIVEREF(__pyx_r);
14483  __Pyx_RefNannyFinishContext();
14484  return __pyx_r;
14485 }
14486 
14487 /* "View.MemoryView":625
14488  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14489  *
14490  * def is_f_contig(self): # <<<<<<<<<<<<<<
14491  * cdef __Pyx_memviewslice *mslice
14492  * cdef __Pyx_memviewslice tmp
14493  */
14494 
14495 /* Python wrapper */
14496 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14497 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14498  PyObject *__pyx_r = 0;
14499  __Pyx_RefNannyDeclarations
14500  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
14501  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14502 
14503  /* function exit code */
14504  __Pyx_RefNannyFinishContext();
14505  return __pyx_r;
14506 }
14507 
14508 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14509  __Pyx_memviewslice *__pyx_v_mslice;
14510  __Pyx_memviewslice __pyx_v_tmp;
14511  PyObject *__pyx_r = NULL;
14512  __Pyx_RefNannyDeclarations
14513  __Pyx_memviewslice *__pyx_t_1;
14514  PyObject *__pyx_t_2 = NULL;
14515  __Pyx_RefNannySetupContext("is_f_contig", 0);
14516 
14517  /* "View.MemoryView":628
14518  * cdef __Pyx_memviewslice *mslice
14519  * cdef __Pyx_memviewslice tmp
14520  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14521  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14522  *
14523  */
14524  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
14525  __pyx_v_mslice = __pyx_t_1;
14526 
14527  /* "View.MemoryView":629
14528  * cdef __Pyx_memviewslice tmp
14529  * mslice = get_slice_from_memview(self, &tmp)
14530  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
14531  *
14532  * def copy(self):
14533  */
14534  __Pyx_XDECREF(__pyx_r);
14535  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
14536  __Pyx_GOTREF(__pyx_t_2);
14537  __pyx_r = __pyx_t_2;
14538  __pyx_t_2 = 0;
14539  goto __pyx_L0;
14540 
14541  /* "View.MemoryView":625
14542  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14543  *
14544  * def is_f_contig(self): # <<<<<<<<<<<<<<
14545  * cdef __Pyx_memviewslice *mslice
14546  * cdef __Pyx_memviewslice tmp
14547  */
14548 
14549  /* function exit code */
14550  __pyx_L1_error:;
14551  __Pyx_XDECREF(__pyx_t_2);
14552  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14553  __pyx_r = NULL;
14554  __pyx_L0:;
14555  __Pyx_XGIVEREF(__pyx_r);
14556  __Pyx_RefNannyFinishContext();
14557  return __pyx_r;
14558 }
14559 
14560 /* "View.MemoryView":631
14561  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14562  *
14563  * def copy(self): # <<<<<<<<<<<<<<
14564  * cdef __Pyx_memviewslice mslice
14565  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14566  */
14567 
14568 /* Python wrapper */
14569 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14570 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14571  PyObject *__pyx_r = 0;
14572  __Pyx_RefNannyDeclarations
14573  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
14574  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
14575 
14576  /* function exit code */
14577  __Pyx_RefNannyFinishContext();
14578  return __pyx_r;
14579 }
14580 
14581 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
14582  __Pyx_memviewslice __pyx_v_mslice;
14583  int __pyx_v_flags;
14584  PyObject *__pyx_r = NULL;
14585  __Pyx_RefNannyDeclarations
14586  __Pyx_memviewslice __pyx_t_1;
14587  PyObject *__pyx_t_2 = NULL;
14588  __Pyx_RefNannySetupContext("copy", 0);
14589 
14590  /* "View.MemoryView":633
14591  * def copy(self):
14592  * cdef __Pyx_memviewslice mslice
14593  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
14594  *
14595  * slice_copy(self, &mslice)
14596  */
14597  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14598 
14599  /* "View.MemoryView":635
14600  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14601  *
14602  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
14603  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
14604  * self.view.itemsize,
14605  */
14606  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14607 
14608  /* "View.MemoryView":636
14609  *
14610  * slice_copy(self, &mslice)
14611  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
14612  * self.view.itemsize,
14613  * flags|PyBUF_C_CONTIGUOUS,
14614  */
14615  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
14616  __pyx_v_mslice = __pyx_t_1;
14617 
14618  /* "View.MemoryView":641
14619  * self.dtype_is_object)
14620  *
14621  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
14622  *
14623  * def copy_fortran(self):
14624  */
14625  __Pyx_XDECREF(__pyx_r);
14626  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
14627  __Pyx_GOTREF(__pyx_t_2);
14628  __pyx_r = __pyx_t_2;
14629  __pyx_t_2 = 0;
14630  goto __pyx_L0;
14631 
14632  /* "View.MemoryView":631
14633  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14634  *
14635  * def copy(self): # <<<<<<<<<<<<<<
14636  * cdef __Pyx_memviewslice mslice
14637  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14638  */
14639 
14640  /* function exit code */
14641  __pyx_L1_error:;
14642  __Pyx_XDECREF(__pyx_t_2);
14643  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14644  __pyx_r = NULL;
14645  __pyx_L0:;
14646  __Pyx_XGIVEREF(__pyx_r);
14647  __Pyx_RefNannyFinishContext();
14648  return __pyx_r;
14649 }
14650 
14651 /* "View.MemoryView":643
14652  * return memoryview_copy_from_slice(self, &mslice)
14653  *
14654  * def copy_fortran(self): # <<<<<<<<<<<<<<
14655  * cdef __Pyx_memviewslice src, dst
14656  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14657  */
14658 
14659 /* Python wrapper */
14660 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14661 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14662  PyObject *__pyx_r = 0;
14663  __Pyx_RefNannyDeclarations
14664  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
14665  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
14666 
14667  /* function exit code */
14668  __Pyx_RefNannyFinishContext();
14669  return __pyx_r;
14670 }
14671 
14672 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
14673  __Pyx_memviewslice __pyx_v_src;
14674  __Pyx_memviewslice __pyx_v_dst;
14675  int __pyx_v_flags;
14676  PyObject *__pyx_r = NULL;
14677  __Pyx_RefNannyDeclarations
14678  __Pyx_memviewslice __pyx_t_1;
14679  PyObject *__pyx_t_2 = NULL;
14680  __Pyx_RefNannySetupContext("copy_fortran", 0);
14681 
14682  /* "View.MemoryView":645
14683  * def copy_fortran(self):
14684  * cdef __Pyx_memviewslice src, dst
14685  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
14686  *
14687  * slice_copy(self, &src)
14688  */
14689  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14690 
14691  /* "View.MemoryView":647
14692  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14693  *
14694  * slice_copy(self, &src) # <<<<<<<<<<<<<<
14695  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
14696  * self.view.itemsize,
14697  */
14698  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14699 
14700  /* "View.MemoryView":648
14701  *
14702  * slice_copy(self, &src)
14703  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
14704  * self.view.itemsize,
14705  * flags|PyBUF_F_CONTIGUOUS,
14706  */
14707  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
14708  __pyx_v_dst = __pyx_t_1;
14709 
14710  /* "View.MemoryView":653
14711  * self.dtype_is_object)
14712  *
14713  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
14714  *
14715  *
14716  */
14717  __Pyx_XDECREF(__pyx_r);
14718  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
14719  __Pyx_GOTREF(__pyx_t_2);
14720  __pyx_r = __pyx_t_2;
14721  __pyx_t_2 = 0;
14722  goto __pyx_L0;
14723 
14724  /* "View.MemoryView":643
14725  * return memoryview_copy_from_slice(self, &mslice)
14726  *
14727  * def copy_fortran(self): # <<<<<<<<<<<<<<
14728  * cdef __Pyx_memviewslice src, dst
14729  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14730  */
14731 
14732  /* function exit code */
14733  __pyx_L1_error:;
14734  __Pyx_XDECREF(__pyx_t_2);
14735  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14736  __pyx_r = NULL;
14737  __pyx_L0:;
14738  __Pyx_XGIVEREF(__pyx_r);
14739  __Pyx_RefNannyFinishContext();
14740  return __pyx_r;
14741 }
14742 
14743 /* "(tree fragment)":1
14744  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14745  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14746  * def __setstate_cython__(self, __pyx_state):
14747  */
14748 
14749 /* Python wrapper */
14750 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14751 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14752  PyObject *__pyx_r = 0;
14753  __Pyx_RefNannyDeclarations
14754  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14755  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14756 
14757  /* function exit code */
14758  __Pyx_RefNannyFinishContext();
14759  return __pyx_r;
14760 }
14761 
14762 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
14763  PyObject *__pyx_r = NULL;
14764  __Pyx_RefNannyDeclarations
14765  PyObject *__pyx_t_1 = NULL;
14766  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14767 
14768  /* "(tree fragment)":2
14769  * def __reduce_cython__(self):
14770  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14771  * def __setstate_cython__(self, __pyx_state):
14772  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14773  */
14774  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
14775  __Pyx_GOTREF(__pyx_t_1);
14776  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14777  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14778  __PYX_ERR(1, 2, __pyx_L1_error)
14779 
14780  /* "(tree fragment)":1
14781  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14782  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14783  * def __setstate_cython__(self, __pyx_state):
14784  */
14785 
14786  /* function exit code */
14787  __pyx_L1_error:;
14788  __Pyx_XDECREF(__pyx_t_1);
14789  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14790  __pyx_r = NULL;
14791  __Pyx_XGIVEREF(__pyx_r);
14792  __Pyx_RefNannyFinishContext();
14793  return __pyx_r;
14794 }
14795 
14796 /* "(tree fragment)":3
14797  * def __reduce_cython__(self):
14798  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14799  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14800  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14801  */
14802 
14803 /* Python wrapper */
14804 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
14805 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14806  PyObject *__pyx_r = 0;
14807  __Pyx_RefNannyDeclarations
14808  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14809  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14810 
14811  /* function exit code */
14812  __Pyx_RefNannyFinishContext();
14813  return __pyx_r;
14814 }
14815 
14816 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14817  PyObject *__pyx_r = NULL;
14818  __Pyx_RefNannyDeclarations
14819  PyObject *__pyx_t_1 = NULL;
14820  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14821 
14822  /* "(tree fragment)":4
14823  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14824  * def __setstate_cython__(self, __pyx_state):
14825  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14826  */
14827  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
14828  __Pyx_GOTREF(__pyx_t_1);
14829  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14830  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14831  __PYX_ERR(1, 4, __pyx_L1_error)
14832 
14833  /* "(tree fragment)":3
14834  * def __reduce_cython__(self):
14835  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14836  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14837  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14838  */
14839 
14840  /* function exit code */
14841  __pyx_L1_error:;
14842  __Pyx_XDECREF(__pyx_t_1);
14843  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14844  __pyx_r = NULL;
14845  __Pyx_XGIVEREF(__pyx_r);
14846  __Pyx_RefNannyFinishContext();
14847  return __pyx_r;
14848 }
14849 
14850 /* "View.MemoryView":657
14851  *
14852  * @cname('__pyx_memoryview_new')
14853  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14854  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14855  * result.typeinfo = typeinfo
14856  */
14857 
14858 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14859  struct __pyx_memoryview_obj *__pyx_v_result = 0;
14860  PyObject *__pyx_r = NULL;
14861  __Pyx_RefNannyDeclarations
14862  PyObject *__pyx_t_1 = NULL;
14863  PyObject *__pyx_t_2 = NULL;
14864  PyObject *__pyx_t_3 = NULL;
14865  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
14866 
14867  /* "View.MemoryView":658
14868  * @cname('__pyx_memoryview_new')
14869  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14870  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
14871  * result.typeinfo = typeinfo
14872  * return result
14873  */
14874  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
14875  __Pyx_GOTREF(__pyx_t_1);
14876  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
14877  __Pyx_GOTREF(__pyx_t_2);
14878  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
14879  __Pyx_GOTREF(__pyx_t_3);
14880  __Pyx_INCREF(__pyx_v_o);
14881  __Pyx_GIVEREF(__pyx_v_o);
14882  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14883  __Pyx_GIVEREF(__pyx_t_1);
14884  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14885  __Pyx_GIVEREF(__pyx_t_2);
14886  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14887  __pyx_t_1 = 0;
14888  __pyx_t_2 = 0;
14889  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
14890  __Pyx_GOTREF(__pyx_t_2);
14891  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14892  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14893  __pyx_t_2 = 0;
14894 
14895  /* "View.MemoryView":659
14896  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14897  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14898  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
14899  * return result
14900  *
14901  */
14902  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14903 
14904  /* "View.MemoryView":660
14905  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14906  * result.typeinfo = typeinfo
14907  * return result # <<<<<<<<<<<<<<
14908  *
14909  * @cname('__pyx_memoryview_check')
14910  */
14911  __Pyx_XDECREF(__pyx_r);
14912  __Pyx_INCREF(((PyObject *)__pyx_v_result));
14913  __pyx_r = ((PyObject *)__pyx_v_result);
14914  goto __pyx_L0;
14915 
14916  /* "View.MemoryView":657
14917  *
14918  * @cname('__pyx_memoryview_new')
14919  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14920  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14921  * result.typeinfo = typeinfo
14922  */
14923 
14924  /* function exit code */
14925  __pyx_L1_error:;
14926  __Pyx_XDECREF(__pyx_t_1);
14927  __Pyx_XDECREF(__pyx_t_2);
14928  __Pyx_XDECREF(__pyx_t_3);
14929  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14930  __pyx_r = 0;
14931  __pyx_L0:;
14932  __Pyx_XDECREF((PyObject *)__pyx_v_result);
14933  __Pyx_XGIVEREF(__pyx_r);
14934  __Pyx_RefNannyFinishContext();
14935  return __pyx_r;
14936 }
14937 
14938 /* "View.MemoryView":663
14939  *
14940  * @cname('__pyx_memoryview_check')
14941  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14942  * return isinstance(o, memoryview)
14943  *
14944  */
14945 
14946 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14947  int __pyx_r;
14948  __Pyx_RefNannyDeclarations
14949  int __pyx_t_1;
14950  __Pyx_RefNannySetupContext("memoryview_check", 0);
14951 
14952  /* "View.MemoryView":664
14953  * @cname('__pyx_memoryview_check')
14954  * cdef inline bint memoryview_check(object o):
14955  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
14956  *
14957  * cdef tuple _unellipsify(object index, int ndim):
14958  */
14959  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14960  __pyx_r = __pyx_t_1;
14961  goto __pyx_L0;
14962 
14963  /* "View.MemoryView":663
14964  *
14965  * @cname('__pyx_memoryview_check')
14966  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14967  * return isinstance(o, memoryview)
14968  *
14969  */
14970 
14971  /* function exit code */
14972  __pyx_L0:;
14973  __Pyx_RefNannyFinishContext();
14974  return __pyx_r;
14975 }
14976 
14977 /* "View.MemoryView":666
14978  * return isinstance(o, memoryview)
14979  *
14980  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14981  * """
14982  * Replace all ellipses with full slices and fill incomplete indices with
14983  */
14984 
14985 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
14986  PyObject *__pyx_v_tup = NULL;
14987  PyObject *__pyx_v_result = NULL;
14988  int __pyx_v_have_slices;
14989  int __pyx_v_seen_ellipsis;
14990  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14991  PyObject *__pyx_v_item = NULL;
14992  Py_ssize_t __pyx_v_nslices;
14993  PyObject *__pyx_r = NULL;
14994  __Pyx_RefNannyDeclarations
14995  int __pyx_t_1;
14996  int __pyx_t_2;
14997  PyObject *__pyx_t_3 = NULL;
14998  PyObject *__pyx_t_4 = NULL;
14999  Py_ssize_t __pyx_t_5;
15000  PyObject *(*__pyx_t_6)(PyObject *);
15001  PyObject *__pyx_t_7 = NULL;
15002  Py_ssize_t __pyx_t_8;
15003  int __pyx_t_9;
15004  int __pyx_t_10;
15005  PyObject *__pyx_t_11 = NULL;
15006  __Pyx_RefNannySetupContext("_unellipsify", 0);
15007 
15008  /* "View.MemoryView":671
15009  * full slices.
15010  * """
15011  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15012  * tup = (index,)
15013  * else:
15014  */
15015  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
15016  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15017  if (__pyx_t_2) {
15018 
15019  /* "View.MemoryView":672
15020  * """
15021  * if not isinstance(index, tuple):
15022  * tup = (index,) # <<<<<<<<<<<<<<
15023  * else:
15024  * tup = index
15025  */
15026  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
15027  __Pyx_GOTREF(__pyx_t_3);
15028  __Pyx_INCREF(__pyx_v_index);
15029  __Pyx_GIVEREF(__pyx_v_index);
15030  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
15031  __pyx_v_tup = __pyx_t_3;
15032  __pyx_t_3 = 0;
15033 
15034  /* "View.MemoryView":671
15035  * full slices.
15036  * """
15037  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15038  * tup = (index,)
15039  * else:
15040  */
15041  goto __pyx_L3;
15042  }
15043 
15044  /* "View.MemoryView":674
15045  * tup = (index,)
15046  * else:
15047  * tup = index # <<<<<<<<<<<<<<
15048  *
15049  * result = []
15050  */
15051  /*else*/ {
15052  __Pyx_INCREF(__pyx_v_index);
15053  __pyx_v_tup = __pyx_v_index;
15054  }
15055  __pyx_L3:;
15056 
15057  /* "View.MemoryView":676
15058  * tup = index
15059  *
15060  * result = [] # <<<<<<<<<<<<<<
15061  * have_slices = False
15062  * seen_ellipsis = False
15063  */
15064  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
15065  __Pyx_GOTREF(__pyx_t_3);
15066  __pyx_v_result = ((PyObject*)__pyx_t_3);
15067  __pyx_t_3 = 0;
15068 
15069  /* "View.MemoryView":677
15070  *
15071  * result = []
15072  * have_slices = False # <<<<<<<<<<<<<<
15073  * seen_ellipsis = False
15074  * for idx, item in enumerate(tup):
15075  */
15076  __pyx_v_have_slices = 0;
15077 
15078  /* "View.MemoryView":678
15079  * result = []
15080  * have_slices = False
15081  * seen_ellipsis = False # <<<<<<<<<<<<<<
15082  * for idx, item in enumerate(tup):
15083  * if item is Ellipsis:
15084  */
15085  __pyx_v_seen_ellipsis = 0;
15086 
15087  /* "View.MemoryView":679
15088  * have_slices = False
15089  * seen_ellipsis = False
15090  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15091  * if item is Ellipsis:
15092  * if not seen_ellipsis:
15093  */
15094  __Pyx_INCREF(__pyx_int_0);
15095  __pyx_t_3 = __pyx_int_0;
15096  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
15097  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
15098  __pyx_t_6 = NULL;
15099  } else {
15100  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
15101  __Pyx_GOTREF(__pyx_t_4);
15102  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
15103  }
15104  for (;;) {
15105  if (likely(!__pyx_t_6)) {
15106  if (likely(PyList_CheckExact(__pyx_t_4))) {
15107  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
15108  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15109  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
15110  #else
15111  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
15112  __Pyx_GOTREF(__pyx_t_7);
15113  #endif
15114  } else {
15115  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
15116  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15117  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
15118  #else
15119  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
15120  __Pyx_GOTREF(__pyx_t_7);
15121  #endif
15122  }
15123  } else {
15124  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
15125  if (unlikely(!__pyx_t_7)) {
15126  PyObject* exc_type = PyErr_Occurred();
15127  if (exc_type) {
15128  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15129  else __PYX_ERR(1, 679, __pyx_L1_error)
15130  }
15131  break;
15132  }
15133  __Pyx_GOTREF(__pyx_t_7);
15134  }
15135  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
15136  __pyx_t_7 = 0;
15137  __Pyx_INCREF(__pyx_t_3);
15138  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
15139  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
15140  __Pyx_GOTREF(__pyx_t_7);
15141  __Pyx_DECREF(__pyx_t_3);
15142  __pyx_t_3 = __pyx_t_7;
15143  __pyx_t_7 = 0;
15144 
15145  /* "View.MemoryView":680
15146  * seen_ellipsis = False
15147  * for idx, item in enumerate(tup):
15148  * if item is Ellipsis: # <<<<<<<<<<<<<<
15149  * if not seen_ellipsis:
15150  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15151  */
15152  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
15153  __pyx_t_1 = (__pyx_t_2 != 0);
15154  if (__pyx_t_1) {
15155 
15156  /* "View.MemoryView":681
15157  * for idx, item in enumerate(tup):
15158  * if item is Ellipsis:
15159  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15160  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15161  * seen_ellipsis = True
15162  */
15163  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
15164  if (__pyx_t_1) {
15165 
15166  /* "View.MemoryView":682
15167  * if item is Ellipsis:
15168  * if not seen_ellipsis:
15169  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
15170  * seen_ellipsis = True
15171  * else:
15172  */
15173  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
15174  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
15175  __Pyx_GOTREF(__pyx_t_7);
15176  { Py_ssize_t __pyx_temp;
15177  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
15178  __Pyx_INCREF(__pyx_slice__27);
15179  __Pyx_GIVEREF(__pyx_slice__27);
15180  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__27);
15181  }
15182  }
15183  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
15184  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15185 
15186  /* "View.MemoryView":683
15187  * if not seen_ellipsis:
15188  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15189  * seen_ellipsis = True # <<<<<<<<<<<<<<
15190  * else:
15191  * result.append(slice(None))
15192  */
15193  __pyx_v_seen_ellipsis = 1;
15194 
15195  /* "View.MemoryView":681
15196  * for idx, item in enumerate(tup):
15197  * if item is Ellipsis:
15198  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15199  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15200  * seen_ellipsis = True
15201  */
15202  goto __pyx_L7;
15203  }
15204 
15205  /* "View.MemoryView":685
15206  * seen_ellipsis = True
15207  * else:
15208  * result.append(slice(None)) # <<<<<<<<<<<<<<
15209  * have_slices = True
15210  * else:
15211  */
15212  /*else*/ {
15213  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__27); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
15214  }
15215  __pyx_L7:;
15216 
15217  /* "View.MemoryView":686
15218  * else:
15219  * result.append(slice(None))
15220  * have_slices = True # <<<<<<<<<<<<<<
15221  * else:
15222  * if not isinstance(item, slice) and not PyIndex_Check(item):
15223  */
15224  __pyx_v_have_slices = 1;
15225 
15226  /* "View.MemoryView":680
15227  * seen_ellipsis = False
15228  * for idx, item in enumerate(tup):
15229  * if item is Ellipsis: # <<<<<<<<<<<<<<
15230  * if not seen_ellipsis:
15231  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15232  */
15233  goto __pyx_L6;
15234  }
15235 
15236  /* "View.MemoryView":688
15237  * have_slices = True
15238  * else:
15239  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15240  * raise TypeError("Cannot index with type '%s'" % type(item))
15241  *
15242  */
15243  /*else*/ {
15244  __pyx_t_2 = PySlice_Check(__pyx_v_item);
15245  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
15246  if (__pyx_t_10) {
15247  } else {
15248  __pyx_t_1 = __pyx_t_10;
15249  goto __pyx_L9_bool_binop_done;
15250  }
15251  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
15252  __pyx_t_1 = __pyx_t_10;
15253  __pyx_L9_bool_binop_done:;
15254  if (unlikely(__pyx_t_1)) {
15255 
15256  /* "View.MemoryView":689
15257  * else:
15258  * if not isinstance(item, slice) and not PyIndex_Check(item):
15259  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
15260  *
15261  * have_slices = have_slices or isinstance(item, slice)
15262  */
15263  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
15264  __Pyx_GOTREF(__pyx_t_7);
15265  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
15266  __Pyx_GOTREF(__pyx_t_11);
15267  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15268  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
15269  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15270  __PYX_ERR(1, 689, __pyx_L1_error)
15271 
15272  /* "View.MemoryView":688
15273  * have_slices = True
15274  * else:
15275  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15276  * raise TypeError("Cannot index with type '%s'" % type(item))
15277  *
15278  */
15279  }
15280 
15281  /* "View.MemoryView":691
15282  * raise TypeError("Cannot index with type '%s'" % type(item))
15283  *
15284  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
15285  * result.append(item)
15286  *
15287  */
15288  __pyx_t_10 = (__pyx_v_have_slices != 0);
15289  if (!__pyx_t_10) {
15290  } else {
15291  __pyx_t_1 = __pyx_t_10;
15292  goto __pyx_L11_bool_binop_done;
15293  }
15294  __pyx_t_10 = PySlice_Check(__pyx_v_item);
15295  __pyx_t_2 = (__pyx_t_10 != 0);
15296  __pyx_t_1 = __pyx_t_2;
15297  __pyx_L11_bool_binop_done:;
15298  __pyx_v_have_slices = __pyx_t_1;
15299 
15300  /* "View.MemoryView":692
15301  *
15302  * have_slices = have_slices or isinstance(item, slice)
15303  * result.append(item) # <<<<<<<<<<<<<<
15304  *
15305  * nslices = ndim - len(result)
15306  */
15307  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
15308  }
15309  __pyx_L6:;
15310 
15311  /* "View.MemoryView":679
15312  * have_slices = False
15313  * seen_ellipsis = False
15314  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15315  * if item is Ellipsis:
15316  * if not seen_ellipsis:
15317  */
15318  }
15319  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15320  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15321 
15322  /* "View.MemoryView":694
15323  * result.append(item)
15324  *
15325  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
15326  * if nslices:
15327  * result.extend([slice(None)] * nslices)
15328  */
15329  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
15330  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15331 
15332  /* "View.MemoryView":695
15333  *
15334  * nslices = ndim - len(result)
15335  * if nslices: # <<<<<<<<<<<<<<
15336  * result.extend([slice(None)] * nslices)
15337  *
15338  */
15339  __pyx_t_1 = (__pyx_v_nslices != 0);
15340  if (__pyx_t_1) {
15341 
15342  /* "View.MemoryView":696
15343  * nslices = ndim - len(result)
15344  * if nslices:
15345  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
15346  *
15347  * return have_slices or nslices, tuple(result)
15348  */
15349  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
15350  __Pyx_GOTREF(__pyx_t_3);
15351  { Py_ssize_t __pyx_temp;
15352  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15353  __Pyx_INCREF(__pyx_slice__27);
15354  __Pyx_GIVEREF(__pyx_slice__27);
15355  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__27);
15356  }
15357  }
15358  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
15359  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15360 
15361  /* "View.MemoryView":695
15362  *
15363  * nslices = ndim - len(result)
15364  * if nslices: # <<<<<<<<<<<<<<
15365  * result.extend([slice(None)] * nslices)
15366  *
15367  */
15368  }
15369 
15370  /* "View.MemoryView":698
15371  * result.extend([slice(None)] * nslices)
15372  *
15373  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
15374  *
15375  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15376  */
15377  __Pyx_XDECREF(__pyx_r);
15378  if (!__pyx_v_have_slices) {
15379  } else {
15380  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15381  __Pyx_GOTREF(__pyx_t_4);
15382  __pyx_t_3 = __pyx_t_4;
15383  __pyx_t_4 = 0;
15384  goto __pyx_L14_bool_binop_done;
15385  }
15386  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15387  __Pyx_GOTREF(__pyx_t_4);
15388  __pyx_t_3 = __pyx_t_4;
15389  __pyx_t_4 = 0;
15390  __pyx_L14_bool_binop_done:;
15391  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15392  __Pyx_GOTREF(__pyx_t_4);
15393  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
15394  __Pyx_GOTREF(__pyx_t_11);
15395  __Pyx_GIVEREF(__pyx_t_3);
15396  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15397  __Pyx_GIVEREF(__pyx_t_4);
15398  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15399  __pyx_t_3 = 0;
15400  __pyx_t_4 = 0;
15401  __pyx_r = ((PyObject*)__pyx_t_11);
15402  __pyx_t_11 = 0;
15403  goto __pyx_L0;
15404 
15405  /* "View.MemoryView":666
15406  * return isinstance(o, memoryview)
15407  *
15408  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15409  * """
15410  * Replace all ellipses with full slices and fill incomplete indices with
15411  */
15412 
15413  /* function exit code */
15414  __pyx_L1_error:;
15415  __Pyx_XDECREF(__pyx_t_3);
15416  __Pyx_XDECREF(__pyx_t_4);
15417  __Pyx_XDECREF(__pyx_t_7);
15418  __Pyx_XDECREF(__pyx_t_11);
15419  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15420  __pyx_r = 0;
15421  __pyx_L0:;
15422  __Pyx_XDECREF(__pyx_v_tup);
15423  __Pyx_XDECREF(__pyx_v_result);
15424  __Pyx_XDECREF(__pyx_v_idx);
15425  __Pyx_XDECREF(__pyx_v_item);
15426  __Pyx_XGIVEREF(__pyx_r);
15427  __Pyx_RefNannyFinishContext();
15428  return __pyx_r;
15429 }
15430 
15431 /* "View.MemoryView":700
15432  * return have_slices or nslices, tuple(result)
15433  *
15434  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15435  * for suboffset in suboffsets[:ndim]:
15436  * if suboffset >= 0:
15437  */
15438 
15439 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
15440  Py_ssize_t __pyx_v_suboffset;
15441  PyObject *__pyx_r = NULL;
15442  __Pyx_RefNannyDeclarations
15443  Py_ssize_t *__pyx_t_1;
15444  Py_ssize_t *__pyx_t_2;
15445  Py_ssize_t *__pyx_t_3;
15446  int __pyx_t_4;
15447  PyObject *__pyx_t_5 = NULL;
15448  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
15449 
15450  /* "View.MemoryView":701
15451  *
15452  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15453  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
15454  * if suboffset >= 0:
15455  * raise ValueError("Indirect dimensions not supported")
15456  */
15457  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15458  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15459  __pyx_t_1 = __pyx_t_3;
15460  __pyx_v_suboffset = (__pyx_t_1[0]);
15461 
15462  /* "View.MemoryView":702
15463  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15464  * for suboffset in suboffsets[:ndim]:
15465  * if suboffset >= 0: # <<<<<<<<<<<<<<
15466  * raise ValueError("Indirect dimensions not supported")
15467  *
15468  */
15469  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15470  if (unlikely(__pyx_t_4)) {
15471 
15472  /* "View.MemoryView":703
15473  * for suboffset in suboffsets[:ndim]:
15474  * if suboffset >= 0:
15475  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
15476  *
15477  *
15478  */
15479  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
15480  __Pyx_GOTREF(__pyx_t_5);
15481  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15482  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15483  __PYX_ERR(1, 703, __pyx_L1_error)
15484 
15485  /* "View.MemoryView":702
15486  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15487  * for suboffset in suboffsets[:ndim]:
15488  * if suboffset >= 0: # <<<<<<<<<<<<<<
15489  * raise ValueError("Indirect dimensions not supported")
15490  *
15491  */
15492  }
15493  }
15494 
15495  /* "View.MemoryView":700
15496  * return have_slices or nslices, tuple(result)
15497  *
15498  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15499  * for suboffset in suboffsets[:ndim]:
15500  * if suboffset >= 0:
15501  */
15502 
15503  /* function exit code */
15504  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15505  goto __pyx_L0;
15506  __pyx_L1_error:;
15507  __Pyx_XDECREF(__pyx_t_5);
15508  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15509  __pyx_r = 0;
15510  __pyx_L0:;
15511  __Pyx_XGIVEREF(__pyx_r);
15512  __Pyx_RefNannyFinishContext();
15513  return __pyx_r;
15514 }
15515 
15516 /* "View.MemoryView":710
15517  *
15518  * @cname('__pyx_memview_slice')
15519  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15520  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15521  * cdef bint negative_step
15522  */
15523 
15524 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15525  int __pyx_v_new_ndim;
15526  int __pyx_v_suboffset_dim;
15527  int __pyx_v_dim;
15528  __Pyx_memviewslice __pyx_v_src;
15529  __Pyx_memviewslice __pyx_v_dst;
15530  __Pyx_memviewslice *__pyx_v_p_src;
15531  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15532  __Pyx_memviewslice *__pyx_v_p_dst;
15533  int *__pyx_v_p_suboffset_dim;
15534  Py_ssize_t __pyx_v_start;
15535  Py_ssize_t __pyx_v_stop;
15536  Py_ssize_t __pyx_v_step;
15537  int __pyx_v_have_start;
15538  int __pyx_v_have_stop;
15539  int __pyx_v_have_step;
15540  PyObject *__pyx_v_index = NULL;
15541  struct __pyx_memoryview_obj *__pyx_r = NULL;
15542  __Pyx_RefNannyDeclarations
15543  int __pyx_t_1;
15544  int __pyx_t_2;
15545  PyObject *__pyx_t_3 = NULL;
15546  struct __pyx_memoryview_obj *__pyx_t_4;
15547  char *__pyx_t_5;
15548  int __pyx_t_6;
15549  Py_ssize_t __pyx_t_7;
15550  PyObject *(*__pyx_t_8)(PyObject *);
15551  PyObject *__pyx_t_9 = NULL;
15552  Py_ssize_t __pyx_t_10;
15553  int __pyx_t_11;
15554  Py_ssize_t __pyx_t_12;
15555  __Pyx_RefNannySetupContext("memview_slice", 0);
15556 
15557  /* "View.MemoryView":711
15558  * @cname('__pyx_memview_slice')
15559  * cdef memoryview memview_slice(memoryview memview, object indices):
15560  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
15561  * cdef bint negative_step
15562  * cdef __Pyx_memviewslice src, dst
15563  */
15564  __pyx_v_new_ndim = 0;
15565  __pyx_v_suboffset_dim = -1;
15566 
15567  /* "View.MemoryView":718
15568  *
15569  *
15570  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
15571  *
15572  * cdef _memoryviewslice memviewsliceobj
15573  */
15574  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
15575 
15576  /* "View.MemoryView":722
15577  * cdef _memoryviewslice memviewsliceobj
15578  *
15579  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
15580  *
15581  * if isinstance(memview, _memoryviewslice):
15582  */
15583  #ifndef CYTHON_WITHOUT_ASSERTIONS
15584  if (unlikely(!Py_OptimizeFlag)) {
15585  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15586  PyErr_SetNone(PyExc_AssertionError);
15587  __PYX_ERR(1, 722, __pyx_L1_error)
15588  }
15589  }
15590  #endif
15591 
15592  /* "View.MemoryView":724
15593  * assert memview.view.ndim > 0
15594  *
15595  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15596  * memviewsliceobj = memview
15597  * p_src = &memviewsliceobj.from_slice
15598  */
15599  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15600  __pyx_t_2 = (__pyx_t_1 != 0);
15601  if (__pyx_t_2) {
15602 
15603  /* "View.MemoryView":725
15604  *
15605  * if isinstance(memview, _memoryviewslice):
15606  * memviewsliceobj = memview # <<<<<<<<<<<<<<
15607  * p_src = &memviewsliceobj.from_slice
15608  * else:
15609  */
15610  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
15611  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15612  __Pyx_INCREF(__pyx_t_3);
15613  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15614  __pyx_t_3 = 0;
15615 
15616  /* "View.MemoryView":726
15617  * if isinstance(memview, _memoryviewslice):
15618  * memviewsliceobj = memview
15619  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
15620  * else:
15621  * slice_copy(memview, &src)
15622  */
15623  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15624 
15625  /* "View.MemoryView":724
15626  * assert memview.view.ndim > 0
15627  *
15628  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15629  * memviewsliceobj = memview
15630  * p_src = &memviewsliceobj.from_slice
15631  */
15632  goto __pyx_L3;
15633  }
15634 
15635  /* "View.MemoryView":728
15636  * p_src = &memviewsliceobj.from_slice
15637  * else:
15638  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
15639  * p_src = &src
15640  *
15641  */
15642  /*else*/ {
15643  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15644 
15645  /* "View.MemoryView":729
15646  * else:
15647  * slice_copy(memview, &src)
15648  * p_src = &src # <<<<<<<<<<<<<<
15649  *
15650  *
15651  */
15652  __pyx_v_p_src = (&__pyx_v_src);
15653  }
15654  __pyx_L3:;
15655 
15656  /* "View.MemoryView":735
15657  *
15658  *
15659  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
15660  * dst.data = p_src.data
15661  *
15662  */
15663  __pyx_t_4 = __pyx_v_p_src->memview;
15664  __pyx_v_dst.memview = __pyx_t_4;
15665 
15666  /* "View.MemoryView":736
15667  *
15668  * dst.memview = p_src.memview
15669  * dst.data = p_src.data # <<<<<<<<<<<<<<
15670  *
15671  *
15672  */
15673  __pyx_t_5 = __pyx_v_p_src->data;
15674  __pyx_v_dst.data = __pyx_t_5;
15675 
15676  /* "View.MemoryView":741
15677  *
15678  *
15679  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
15680  * cdef int *p_suboffset_dim = &suboffset_dim
15681  * cdef Py_ssize_t start, stop, step
15682  */
15683  __pyx_v_p_dst = (&__pyx_v_dst);
15684 
15685  /* "View.MemoryView":742
15686  *
15687  * cdef __Pyx_memviewslice *p_dst = &dst
15688  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
15689  * cdef Py_ssize_t start, stop, step
15690  * cdef bint have_start, have_stop, have_step
15691  */
15692  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15693 
15694  /* "View.MemoryView":746
15695  * cdef bint have_start, have_stop, have_step
15696  *
15697  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15698  * if PyIndex_Check(index):
15699  * slice_memviewslice(
15700  */
15701  __pyx_t_6 = 0;
15702  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15703  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15704  __pyx_t_8 = NULL;
15705  } else {
15706  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
15707  __Pyx_GOTREF(__pyx_t_3);
15708  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
15709  }
15710  for (;;) {
15711  if (likely(!__pyx_t_8)) {
15712  if (likely(PyList_CheckExact(__pyx_t_3))) {
15713  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
15714  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15715  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
15716  #else
15717  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15718  __Pyx_GOTREF(__pyx_t_9);
15719  #endif
15720  } else {
15721  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
15722  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15723  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
15724  #else
15725  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15726  __Pyx_GOTREF(__pyx_t_9);
15727  #endif
15728  }
15729  } else {
15730  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15731  if (unlikely(!__pyx_t_9)) {
15732  PyObject* exc_type = PyErr_Occurred();
15733  if (exc_type) {
15734  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15735  else __PYX_ERR(1, 746, __pyx_L1_error)
15736  }
15737  break;
15738  }
15739  __Pyx_GOTREF(__pyx_t_9);
15740  }
15741  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15742  __pyx_t_9 = 0;
15743  __pyx_v_dim = __pyx_t_6;
15744  __pyx_t_6 = (__pyx_t_6 + 1);
15745 
15746  /* "View.MemoryView":747
15747  *
15748  * for dim, index in enumerate(indices):
15749  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15750  * slice_memviewslice(
15751  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15752  */
15753  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15754  if (__pyx_t_2) {
15755 
15756  /* "View.MemoryView":751
15757  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15758  * dim, new_ndim, p_suboffset_dim,
15759  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
15760  * 0, 0, 0, # have_{start,stop,step}
15761  * False)
15762  */
15763  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
15764 
15765  /* "View.MemoryView":748
15766  * for dim, index in enumerate(indices):
15767  * if PyIndex_Check(index):
15768  * slice_memviewslice( # <<<<<<<<<<<<<<
15769  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15770  * dim, new_ndim, p_suboffset_dim,
15771  */
15772  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
15773 
15774  /* "View.MemoryView":747
15775  *
15776  * for dim, index in enumerate(indices):
15777  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15778  * slice_memviewslice(
15779  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15780  */
15781  goto __pyx_L6;
15782  }
15783 
15784  /* "View.MemoryView":754
15785  * 0, 0, 0, # have_{start,stop,step}
15786  * False)
15787  * elif index is None: # <<<<<<<<<<<<<<
15788  * p_dst.shape[new_ndim] = 1
15789  * p_dst.strides[new_ndim] = 0
15790  */
15791  __pyx_t_2 = (__pyx_v_index == Py_None);
15792  __pyx_t_1 = (__pyx_t_2 != 0);
15793  if (__pyx_t_1) {
15794 
15795  /* "View.MemoryView":755
15796  * False)
15797  * elif index is None:
15798  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
15799  * p_dst.strides[new_ndim] = 0
15800  * p_dst.suboffsets[new_ndim] = -1
15801  */
15802  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15803 
15804  /* "View.MemoryView":756
15805  * elif index is None:
15806  * p_dst.shape[new_ndim] = 1
15807  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
15808  * p_dst.suboffsets[new_ndim] = -1
15809  * new_ndim += 1
15810  */
15811  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15812 
15813  /* "View.MemoryView":757
15814  * p_dst.shape[new_ndim] = 1
15815  * p_dst.strides[new_ndim] = 0
15816  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
15817  * new_ndim += 1
15818  * else:
15819  */
15820  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
15821 
15822  /* "View.MemoryView":758
15823  * p_dst.strides[new_ndim] = 0
15824  * p_dst.suboffsets[new_ndim] = -1
15825  * new_ndim += 1 # <<<<<<<<<<<<<<
15826  * else:
15827  * start = index.start or 0
15828  */
15829  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15830 
15831  /* "View.MemoryView":754
15832  * 0, 0, 0, # have_{start,stop,step}
15833  * False)
15834  * elif index is None: # <<<<<<<<<<<<<<
15835  * p_dst.shape[new_ndim] = 1
15836  * p_dst.strides[new_ndim] = 0
15837  */
15838  goto __pyx_L6;
15839  }
15840 
15841  /* "View.MemoryView":760
15842  * new_ndim += 1
15843  * else:
15844  * start = index.start or 0 # <<<<<<<<<<<<<<
15845  * stop = index.stop or 0
15846  * step = index.step or 0
15847  */
15848  /*else*/ {
15849  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
15850  __Pyx_GOTREF(__pyx_t_9);
15851  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
15852  if (!__pyx_t_1) {
15853  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15854  } else {
15855  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
15856  __pyx_t_10 = __pyx_t_12;
15857  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15858  goto __pyx_L7_bool_binop_done;
15859  }
15860  __pyx_t_10 = 0;
15861  __pyx_L7_bool_binop_done:;
15862  __pyx_v_start = __pyx_t_10;
15863 
15864  /* "View.MemoryView":761
15865  * else:
15866  * start = index.start or 0
15867  * stop = index.stop or 0 # <<<<<<<<<<<<<<
15868  * step = index.step or 0
15869  *
15870  */
15871  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
15872  __Pyx_GOTREF(__pyx_t_9);
15873  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
15874  if (!__pyx_t_1) {
15875  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15876  } else {
15877  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
15878  __pyx_t_10 = __pyx_t_12;
15879  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15880  goto __pyx_L9_bool_binop_done;
15881  }
15882  __pyx_t_10 = 0;
15883  __pyx_L9_bool_binop_done:;
15884  __pyx_v_stop = __pyx_t_10;
15885 
15886  /* "View.MemoryView":762
15887  * start = index.start or 0
15888  * stop = index.stop or 0
15889  * step = index.step or 0 # <<<<<<<<<<<<<<
15890  *
15891  * have_start = index.start is not None
15892  */
15893  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
15894  __Pyx_GOTREF(__pyx_t_9);
15895  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
15896  if (!__pyx_t_1) {
15897  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15898  } else {
15899  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
15900  __pyx_t_10 = __pyx_t_12;
15901  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15902  goto __pyx_L11_bool_binop_done;
15903  }
15904  __pyx_t_10 = 0;
15905  __pyx_L11_bool_binop_done:;
15906  __pyx_v_step = __pyx_t_10;
15907 
15908  /* "View.MemoryView":764
15909  * step = index.step or 0
15910  *
15911  * have_start = index.start is not None # <<<<<<<<<<<<<<
15912  * have_stop = index.stop is not None
15913  * have_step = index.step is not None
15914  */
15915  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
15916  __Pyx_GOTREF(__pyx_t_9);
15917  __pyx_t_1 = (__pyx_t_9 != Py_None);
15918  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15919  __pyx_v_have_start = __pyx_t_1;
15920 
15921  /* "View.MemoryView":765
15922  *
15923  * have_start = index.start is not None
15924  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
15925  * have_step = index.step is not None
15926  *
15927  */
15928  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
15929  __Pyx_GOTREF(__pyx_t_9);
15930  __pyx_t_1 = (__pyx_t_9 != Py_None);
15931  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15932  __pyx_v_have_stop = __pyx_t_1;
15933 
15934  /* "View.MemoryView":766
15935  * have_start = index.start is not None
15936  * have_stop = index.stop is not None
15937  * have_step = index.step is not None # <<<<<<<<<<<<<<
15938  *
15939  * slice_memviewslice(
15940  */
15941  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
15942  __Pyx_GOTREF(__pyx_t_9);
15943  __pyx_t_1 = (__pyx_t_9 != Py_None);
15944  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15945  __pyx_v_have_step = __pyx_t_1;
15946 
15947  /* "View.MemoryView":768
15948  * have_step = index.step is not None
15949  *
15950  * slice_memviewslice( # <<<<<<<<<<<<<<
15951  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15952  * dim, new_ndim, p_suboffset_dim,
15953  */
15954  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
15955 
15956  /* "View.MemoryView":774
15957  * have_start, have_stop, have_step,
15958  * True)
15959  * new_ndim += 1 # <<<<<<<<<<<<<<
15960  *
15961  * if isinstance(memview, _memoryviewslice):
15962  */
15963  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15964  }
15965  __pyx_L6:;
15966 
15967  /* "View.MemoryView":746
15968  * cdef bint have_start, have_stop, have_step
15969  *
15970  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15971  * if PyIndex_Check(index):
15972  * slice_memviewslice(
15973  */
15974  }
15975  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15976 
15977  /* "View.MemoryView":776
15978  * new_ndim += 1
15979  *
15980  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15981  * return memoryview_fromslice(dst, new_ndim,
15982  * memviewsliceobj.to_object_func,
15983  */
15984  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15985  __pyx_t_2 = (__pyx_t_1 != 0);
15986  if (__pyx_t_2) {
15987 
15988  /* "View.MemoryView":777
15989  *
15990  * if isinstance(memview, _memoryviewslice):
15991  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15992  * memviewsliceobj.to_object_func,
15993  * memviewsliceobj.to_dtype_func,
15994  */
15995  __Pyx_XDECREF(((PyObject *)__pyx_r));
15996 
15997  /* "View.MemoryView":778
15998  * if isinstance(memview, _memoryviewslice):
15999  * return memoryview_fromslice(dst, new_ndim,
16000  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
16001  * memviewsliceobj.to_dtype_func,
16002  * memview.dtype_is_object)
16003  */
16004  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
16005 
16006  /* "View.MemoryView":779
16007  * return memoryview_fromslice(dst, new_ndim,
16008  * memviewsliceobj.to_object_func,
16009  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
16010  * memview.dtype_is_object)
16011  * else:
16012  */
16013  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
16014 
16015  /* "View.MemoryView":777
16016  *
16017  * if isinstance(memview, _memoryviewslice):
16018  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
16019  * memviewsliceobj.to_object_func,
16020  * memviewsliceobj.to_dtype_func,
16021  */
16022  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
16023  __Pyx_GOTREF(__pyx_t_3);
16024  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
16025  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16026  __pyx_t_3 = 0;
16027  goto __pyx_L0;
16028 
16029  /* "View.MemoryView":776
16030  * new_ndim += 1
16031  *
16032  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16033  * return memoryview_fromslice(dst, new_ndim,
16034  * memviewsliceobj.to_object_func,
16035  */
16036  }
16037 
16038  /* "View.MemoryView":782
16039  * memview.dtype_is_object)
16040  * else:
16041  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16042  * memview.dtype_is_object)
16043  *
16044  */
16045  /*else*/ {
16046  __Pyx_XDECREF(((PyObject *)__pyx_r));
16047 
16048  /* "View.MemoryView":783
16049  * else:
16050  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
16051  * memview.dtype_is_object) # <<<<<<<<<<<<<<
16052  *
16053  *
16054  */
16055  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
16056  __Pyx_GOTREF(__pyx_t_3);
16057 
16058  /* "View.MemoryView":782
16059  * memview.dtype_is_object)
16060  * else:
16061  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16062  * memview.dtype_is_object)
16063  *
16064  */
16065  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
16066  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16067  __pyx_t_3 = 0;
16068  goto __pyx_L0;
16069  }
16070 
16071  /* "View.MemoryView":710
16072  *
16073  * @cname('__pyx_memview_slice')
16074  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
16075  * cdef int new_ndim = 0, suboffset_dim = -1, dim
16076  * cdef bint negative_step
16077  */
16078 
16079  /* function exit code */
16080  __pyx_L1_error:;
16081  __Pyx_XDECREF(__pyx_t_3);
16082  __Pyx_XDECREF(__pyx_t_9);
16083  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16084  __pyx_r = 0;
16085  __pyx_L0:;
16086  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
16087  __Pyx_XDECREF(__pyx_v_index);
16088  __Pyx_XGIVEREF((PyObject *)__pyx_r);
16089  __Pyx_RefNannyFinishContext();
16090  return __pyx_r;
16091 }
16092 
16093 /* "View.MemoryView":807
16094  *
16095  * @cname('__pyx_memoryview_slice_memviewslice')
16096  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16097  * __Pyx_memviewslice *dst,
16098  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16099  */
16100 
16101 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
16102  Py_ssize_t __pyx_v_new_shape;
16103  int __pyx_v_negative_step;
16104  int __pyx_r;
16105  int __pyx_t_1;
16106  int __pyx_t_2;
16107  int __pyx_t_3;
16108 
16109  /* "View.MemoryView":827
16110  * cdef bint negative_step
16111  *
16112  * if not is_slice: # <<<<<<<<<<<<<<
16113  *
16114  * if start < 0:
16115  */
16116  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
16117  if (__pyx_t_1) {
16118 
16119  /* "View.MemoryView":829
16120  * if not is_slice:
16121  *
16122  * if start < 0: # <<<<<<<<<<<<<<
16123  * start += shape
16124  * if not 0 <= start < shape:
16125  */
16126  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
16127  if (__pyx_t_1) {
16128 
16129  /* "View.MemoryView":830
16130  *
16131  * if start < 0:
16132  * start += shape # <<<<<<<<<<<<<<
16133  * if not 0 <= start < shape:
16134  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16135  */
16136  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16137 
16138  /* "View.MemoryView":829
16139  * if not is_slice:
16140  *
16141  * if start < 0: # <<<<<<<<<<<<<<
16142  * start += shape
16143  * if not 0 <= start < shape:
16144  */
16145  }
16146 
16147  /* "View.MemoryView":831
16148  * if start < 0:
16149  * start += shape
16150  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16151  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16152  * else:
16153  */
16154  __pyx_t_1 = (0 <= __pyx_v_start);
16155  if (__pyx_t_1) {
16156  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
16157  }
16158  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16159  if (__pyx_t_2) {
16160 
16161  /* "View.MemoryView":832
16162  * start += shape
16163  * if not 0 <= start < shape:
16164  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
16165  * else:
16166  *
16167  */
16168  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
16169 
16170  /* "View.MemoryView":831
16171  * if start < 0:
16172  * start += shape
16173  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16174  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16175  * else:
16176  */
16177  }
16178 
16179  /* "View.MemoryView":827
16180  * cdef bint negative_step
16181  *
16182  * if not is_slice: # <<<<<<<<<<<<<<
16183  *
16184  * if start < 0:
16185  */
16186  goto __pyx_L3;
16187  }
16188 
16189  /* "View.MemoryView":835
16190  * else:
16191  *
16192  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
16193  *
16194  * if have_step and step == 0:
16195  */
16196  /*else*/ {
16197  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
16198  if (__pyx_t_1) {
16199  } else {
16200  __pyx_t_2 = __pyx_t_1;
16201  goto __pyx_L6_bool_binop_done;
16202  }
16203  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
16204  __pyx_t_2 = __pyx_t_1;
16205  __pyx_L6_bool_binop_done:;
16206  __pyx_v_negative_step = __pyx_t_2;
16207 
16208  /* "View.MemoryView":837
16209  * negative_step = have_step != 0 and step < 0
16210  *
16211  * if have_step and step == 0: # <<<<<<<<<<<<<<
16212  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16213  *
16214  */
16215  __pyx_t_1 = (__pyx_v_have_step != 0);
16216  if (__pyx_t_1) {
16217  } else {
16218  __pyx_t_2 = __pyx_t_1;
16219  goto __pyx_L9_bool_binop_done;
16220  }
16221  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
16222  __pyx_t_2 = __pyx_t_1;
16223  __pyx_L9_bool_binop_done:;
16224  if (__pyx_t_2) {
16225 
16226  /* "View.MemoryView":838
16227  *
16228  * if have_step and step == 0:
16229  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
16230  *
16231  *
16232  */
16233  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
16234 
16235  /* "View.MemoryView":837
16236  * negative_step = have_step != 0 and step < 0
16237  *
16238  * if have_step and step == 0: # <<<<<<<<<<<<<<
16239  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16240  *
16241  */
16242  }
16243 
16244  /* "View.MemoryView":841
16245  *
16246  *
16247  * if have_start: # <<<<<<<<<<<<<<
16248  * if start < 0:
16249  * start += shape
16250  */
16251  __pyx_t_2 = (__pyx_v_have_start != 0);
16252  if (__pyx_t_2) {
16253 
16254  /* "View.MemoryView":842
16255  *
16256  * if have_start:
16257  * if start < 0: # <<<<<<<<<<<<<<
16258  * start += shape
16259  * if start < 0:
16260  */
16261  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16262  if (__pyx_t_2) {
16263 
16264  /* "View.MemoryView":843
16265  * if have_start:
16266  * if start < 0:
16267  * start += shape # <<<<<<<<<<<<<<
16268  * if start < 0:
16269  * start = 0
16270  */
16271  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16272 
16273  /* "View.MemoryView":844
16274  * if start < 0:
16275  * start += shape
16276  * if start < 0: # <<<<<<<<<<<<<<
16277  * start = 0
16278  * elif start >= shape:
16279  */
16280  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16281  if (__pyx_t_2) {
16282 
16283  /* "View.MemoryView":845
16284  * start += shape
16285  * if start < 0:
16286  * start = 0 # <<<<<<<<<<<<<<
16287  * elif start >= shape:
16288  * if negative_step:
16289  */
16290  __pyx_v_start = 0;
16291 
16292  /* "View.MemoryView":844
16293  * if start < 0:
16294  * start += shape
16295  * if start < 0: # <<<<<<<<<<<<<<
16296  * start = 0
16297  * elif start >= shape:
16298  */
16299  }
16300 
16301  /* "View.MemoryView":842
16302  *
16303  * if have_start:
16304  * if start < 0: # <<<<<<<<<<<<<<
16305  * start += shape
16306  * if start < 0:
16307  */
16308  goto __pyx_L12;
16309  }
16310 
16311  /* "View.MemoryView":846
16312  * if start < 0:
16313  * start = 0
16314  * elif start >= shape: # <<<<<<<<<<<<<<
16315  * if negative_step:
16316  * start = shape - 1
16317  */
16318  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16319  if (__pyx_t_2) {
16320 
16321  /* "View.MemoryView":847
16322  * start = 0
16323  * elif start >= shape:
16324  * if negative_step: # <<<<<<<<<<<<<<
16325  * start = shape - 1
16326  * else:
16327  */
16328  __pyx_t_2 = (__pyx_v_negative_step != 0);
16329  if (__pyx_t_2) {
16330 
16331  /* "View.MemoryView":848
16332  * elif start >= shape:
16333  * if negative_step:
16334  * start = shape - 1 # <<<<<<<<<<<<<<
16335  * else:
16336  * start = shape
16337  */
16338  __pyx_v_start = (__pyx_v_shape - 1);
16339 
16340  /* "View.MemoryView":847
16341  * start = 0
16342  * elif start >= shape:
16343  * if negative_step: # <<<<<<<<<<<<<<
16344  * start = shape - 1
16345  * else:
16346  */
16347  goto __pyx_L14;
16348  }
16349 
16350  /* "View.MemoryView":850
16351  * start = shape - 1
16352  * else:
16353  * start = shape # <<<<<<<<<<<<<<
16354  * else:
16355  * if negative_step:
16356  */
16357  /*else*/ {
16358  __pyx_v_start = __pyx_v_shape;
16359  }
16360  __pyx_L14:;
16361 
16362  /* "View.MemoryView":846
16363  * if start < 0:
16364  * start = 0
16365  * elif start >= shape: # <<<<<<<<<<<<<<
16366  * if negative_step:
16367  * start = shape - 1
16368  */
16369  }
16370  __pyx_L12:;
16371 
16372  /* "View.MemoryView":841
16373  *
16374  *
16375  * if have_start: # <<<<<<<<<<<<<<
16376  * if start < 0:
16377  * start += shape
16378  */
16379  goto __pyx_L11;
16380  }
16381 
16382  /* "View.MemoryView":852
16383  * start = shape
16384  * else:
16385  * if negative_step: # <<<<<<<<<<<<<<
16386  * start = shape - 1
16387  * else:
16388  */
16389  /*else*/ {
16390  __pyx_t_2 = (__pyx_v_negative_step != 0);
16391  if (__pyx_t_2) {
16392 
16393  /* "View.MemoryView":853
16394  * else:
16395  * if negative_step:
16396  * start = shape - 1 # <<<<<<<<<<<<<<
16397  * else:
16398  * start = 0
16399  */
16400  __pyx_v_start = (__pyx_v_shape - 1);
16401 
16402  /* "View.MemoryView":852
16403  * start = shape
16404  * else:
16405  * if negative_step: # <<<<<<<<<<<<<<
16406  * start = shape - 1
16407  * else:
16408  */
16409  goto __pyx_L15;
16410  }
16411 
16412  /* "View.MemoryView":855
16413  * start = shape - 1
16414  * else:
16415  * start = 0 # <<<<<<<<<<<<<<
16416  *
16417  * if have_stop:
16418  */
16419  /*else*/ {
16420  __pyx_v_start = 0;
16421  }
16422  __pyx_L15:;
16423  }
16424  __pyx_L11:;
16425 
16426  /* "View.MemoryView":857
16427  * start = 0
16428  *
16429  * if have_stop: # <<<<<<<<<<<<<<
16430  * if stop < 0:
16431  * stop += shape
16432  */
16433  __pyx_t_2 = (__pyx_v_have_stop != 0);
16434  if (__pyx_t_2) {
16435 
16436  /* "View.MemoryView":858
16437  *
16438  * if have_stop:
16439  * if stop < 0: # <<<<<<<<<<<<<<
16440  * stop += shape
16441  * if stop < 0:
16442  */
16443  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16444  if (__pyx_t_2) {
16445 
16446  /* "View.MemoryView":859
16447  * if have_stop:
16448  * if stop < 0:
16449  * stop += shape # <<<<<<<<<<<<<<
16450  * if stop < 0:
16451  * stop = 0
16452  */
16453  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16454 
16455  /* "View.MemoryView":860
16456  * if stop < 0:
16457  * stop += shape
16458  * if stop < 0: # <<<<<<<<<<<<<<
16459  * stop = 0
16460  * elif stop > shape:
16461  */
16462  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16463  if (__pyx_t_2) {
16464 
16465  /* "View.MemoryView":861
16466  * stop += shape
16467  * if stop < 0:
16468  * stop = 0 # <<<<<<<<<<<<<<
16469  * elif stop > shape:
16470  * stop = shape
16471  */
16472  __pyx_v_stop = 0;
16473 
16474  /* "View.MemoryView":860
16475  * if stop < 0:
16476  * stop += shape
16477  * if stop < 0: # <<<<<<<<<<<<<<
16478  * stop = 0
16479  * elif stop > shape:
16480  */
16481  }
16482 
16483  /* "View.MemoryView":858
16484  *
16485  * if have_stop:
16486  * if stop < 0: # <<<<<<<<<<<<<<
16487  * stop += shape
16488  * if stop < 0:
16489  */
16490  goto __pyx_L17;
16491  }
16492 
16493  /* "View.MemoryView":862
16494  * if stop < 0:
16495  * stop = 0
16496  * elif stop > shape: # <<<<<<<<<<<<<<
16497  * stop = shape
16498  * else:
16499  */
16500  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16501  if (__pyx_t_2) {
16502 
16503  /* "View.MemoryView":863
16504  * stop = 0
16505  * elif stop > shape:
16506  * stop = shape # <<<<<<<<<<<<<<
16507  * else:
16508  * if negative_step:
16509  */
16510  __pyx_v_stop = __pyx_v_shape;
16511 
16512  /* "View.MemoryView":862
16513  * if stop < 0:
16514  * stop = 0
16515  * elif stop > shape: # <<<<<<<<<<<<<<
16516  * stop = shape
16517  * else:
16518  */
16519  }
16520  __pyx_L17:;
16521 
16522  /* "View.MemoryView":857
16523  * start = 0
16524  *
16525  * if have_stop: # <<<<<<<<<<<<<<
16526  * if stop < 0:
16527  * stop += shape
16528  */
16529  goto __pyx_L16;
16530  }
16531 
16532  /* "View.MemoryView":865
16533  * stop = shape
16534  * else:
16535  * if negative_step: # <<<<<<<<<<<<<<
16536  * stop = -1
16537  * else:
16538  */
16539  /*else*/ {
16540  __pyx_t_2 = (__pyx_v_negative_step != 0);
16541  if (__pyx_t_2) {
16542 
16543  /* "View.MemoryView":866
16544  * else:
16545  * if negative_step:
16546  * stop = -1 # <<<<<<<<<<<<<<
16547  * else:
16548  * stop = shape
16549  */
16550  __pyx_v_stop = -1L;
16551 
16552  /* "View.MemoryView":865
16553  * stop = shape
16554  * else:
16555  * if negative_step: # <<<<<<<<<<<<<<
16556  * stop = -1
16557  * else:
16558  */
16559  goto __pyx_L19;
16560  }
16561 
16562  /* "View.MemoryView":868
16563  * stop = -1
16564  * else:
16565  * stop = shape # <<<<<<<<<<<<<<
16566  *
16567  * if not have_step:
16568  */
16569  /*else*/ {
16570  __pyx_v_stop = __pyx_v_shape;
16571  }
16572  __pyx_L19:;
16573  }
16574  __pyx_L16:;
16575 
16576  /* "View.MemoryView":870
16577  * stop = shape
16578  *
16579  * if not have_step: # <<<<<<<<<<<<<<
16580  * step = 1
16581  *
16582  */
16583  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16584  if (__pyx_t_2) {
16585 
16586  /* "View.MemoryView":871
16587  *
16588  * if not have_step:
16589  * step = 1 # <<<<<<<<<<<<<<
16590  *
16591  *
16592  */
16593  __pyx_v_step = 1;
16594 
16595  /* "View.MemoryView":870
16596  * stop = shape
16597  *
16598  * if not have_step: # <<<<<<<<<<<<<<
16599  * step = 1
16600  *
16601  */
16602  }
16603 
16604  /* "View.MemoryView":875
16605  *
16606  * with cython.cdivision(True):
16607  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
16608  *
16609  * if (stop - start) - step * new_shape:
16610  */
16611  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16612 
16613  /* "View.MemoryView":877
16614  * new_shape = (stop - start) // step
16615  *
16616  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16617  * new_shape += 1
16618  *
16619  */
16620  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16621  if (__pyx_t_2) {
16622 
16623  /* "View.MemoryView":878
16624  *
16625  * if (stop - start) - step * new_shape:
16626  * new_shape += 1 # <<<<<<<<<<<<<<
16627  *
16628  * if new_shape < 0:
16629  */
16630  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16631 
16632  /* "View.MemoryView":877
16633  * new_shape = (stop - start) // step
16634  *
16635  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16636  * new_shape += 1
16637  *
16638  */
16639  }
16640 
16641  /* "View.MemoryView":880
16642  * new_shape += 1
16643  *
16644  * if new_shape < 0: # <<<<<<<<<<<<<<
16645  * new_shape = 0
16646  *
16647  */
16648  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16649  if (__pyx_t_2) {
16650 
16651  /* "View.MemoryView":881
16652  *
16653  * if new_shape < 0:
16654  * new_shape = 0 # <<<<<<<<<<<<<<
16655  *
16656  *
16657  */
16658  __pyx_v_new_shape = 0;
16659 
16660  /* "View.MemoryView":880
16661  * new_shape += 1
16662  *
16663  * if new_shape < 0: # <<<<<<<<<<<<<<
16664  * new_shape = 0
16665  *
16666  */
16667  }
16668 
16669  /* "View.MemoryView":884
16670  *
16671  *
16672  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
16673  * dst.shape[new_ndim] = new_shape
16674  * dst.suboffsets[new_ndim] = suboffset
16675  */
16676  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16677 
16678  /* "View.MemoryView":885
16679  *
16680  * dst.strides[new_ndim] = stride * step
16681  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
16682  * dst.suboffsets[new_ndim] = suboffset
16683  *
16684  */
16685  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16686 
16687  /* "View.MemoryView":886
16688  * dst.strides[new_ndim] = stride * step
16689  * dst.shape[new_ndim] = new_shape
16690  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
16691  *
16692  *
16693  */
16694  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16695  }
16696  __pyx_L3:;
16697 
16698  /* "View.MemoryView":889
16699  *
16700  *
16701  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16702  * dst.data += start * stride
16703  * else:
16704  */
16705  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16706  if (__pyx_t_2) {
16707 
16708  /* "View.MemoryView":890
16709  *
16710  * if suboffset_dim[0] < 0:
16711  * dst.data += start * stride # <<<<<<<<<<<<<<
16712  * else:
16713  * dst.suboffsets[suboffset_dim[0]] += start * stride
16714  */
16715  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16716 
16717  /* "View.MemoryView":889
16718  *
16719  *
16720  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16721  * dst.data += start * stride
16722  * else:
16723  */
16724  goto __pyx_L23;
16725  }
16726 
16727  /* "View.MemoryView":892
16728  * dst.data += start * stride
16729  * else:
16730  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
16731  *
16732  * if suboffset >= 0:
16733  */
16734  /*else*/ {
16735  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16736  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16737  }
16738  __pyx_L23:;
16739 
16740  /* "View.MemoryView":894
16741  * dst.suboffsets[suboffset_dim[0]] += start * stride
16742  *
16743  * if suboffset >= 0: # <<<<<<<<<<<<<<
16744  * if not is_slice:
16745  * if new_ndim == 0:
16746  */
16747  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16748  if (__pyx_t_2) {
16749 
16750  /* "View.MemoryView":895
16751  *
16752  * if suboffset >= 0:
16753  * if not is_slice: # <<<<<<<<<<<<<<
16754  * if new_ndim == 0:
16755  * dst.data = (<char **> dst.data)[0] + suboffset
16756  */
16757  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16758  if (__pyx_t_2) {
16759 
16760  /* "View.MemoryView":896
16761  * if suboffset >= 0:
16762  * if not is_slice:
16763  * if new_ndim == 0: # <<<<<<<<<<<<<<
16764  * dst.data = (<char **> dst.data)[0] + suboffset
16765  * else:
16766  */
16767  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16768  if (__pyx_t_2) {
16769 
16770  /* "View.MemoryView":897
16771  * if not is_slice:
16772  * if new_ndim == 0:
16773  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
16774  * else:
16775  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16776  */
16777  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16778 
16779  /* "View.MemoryView":896
16780  * if suboffset >= 0:
16781  * if not is_slice:
16782  * if new_ndim == 0: # <<<<<<<<<<<<<<
16783  * dst.data = (<char **> dst.data)[0] + suboffset
16784  * else:
16785  */
16786  goto __pyx_L26;
16787  }
16788 
16789  /* "View.MemoryView":899
16790  * dst.data = (<char **> dst.data)[0] + suboffset
16791  * else:
16792  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
16793  * "must be indexed and not sliced", dim)
16794  * else:
16795  */
16796  /*else*/ {
16797 
16798  /* "View.MemoryView":900
16799  * else:
16800  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16801  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
16802  * else:
16803  * suboffset_dim[0] = new_ndim
16804  */
16805  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
16806  }
16807  __pyx_L26:;
16808 
16809  /* "View.MemoryView":895
16810  *
16811  * if suboffset >= 0:
16812  * if not is_slice: # <<<<<<<<<<<<<<
16813  * if new_ndim == 0:
16814  * dst.data = (<char **> dst.data)[0] + suboffset
16815  */
16816  goto __pyx_L25;
16817  }
16818 
16819  /* "View.MemoryView":902
16820  * "must be indexed and not sliced", dim)
16821  * else:
16822  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
16823  *
16824  * return 0
16825  */
16826  /*else*/ {
16827  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16828  }
16829  __pyx_L25:;
16830 
16831  /* "View.MemoryView":894
16832  * dst.suboffsets[suboffset_dim[0]] += start * stride
16833  *
16834  * if suboffset >= 0: # <<<<<<<<<<<<<<
16835  * if not is_slice:
16836  * if new_ndim == 0:
16837  */
16838  }
16839 
16840  /* "View.MemoryView":904
16841  * suboffset_dim[0] = new_ndim
16842  *
16843  * return 0 # <<<<<<<<<<<<<<
16844  *
16845  *
16846  */
16847  __pyx_r = 0;
16848  goto __pyx_L0;
16849 
16850  /* "View.MemoryView":807
16851  *
16852  * @cname('__pyx_memoryview_slice_memviewslice')
16853  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16854  * __Pyx_memviewslice *dst,
16855  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16856  */
16857 
16858  /* function exit code */
16859  __pyx_L1_error:;
16860  {
16861  #ifdef WITH_THREAD
16862  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16863  #endif
16864  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16865  #ifdef WITH_THREAD
16866  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16867  #endif
16868  }
16869  __pyx_r = -1;
16870  __pyx_L0:;
16871  return __pyx_r;
16872 }
16873 
16874 /* "View.MemoryView":910
16875  *
16876  * @cname('__pyx_pybuffer_index')
16877  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16878  * Py_ssize_t dim) except NULL:
16879  * cdef Py_ssize_t shape, stride, suboffset = -1
16880  */
16881 
16882 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
16883  Py_ssize_t __pyx_v_shape;
16884  Py_ssize_t __pyx_v_stride;
16885  Py_ssize_t __pyx_v_suboffset;
16886  Py_ssize_t __pyx_v_itemsize;
16887  char *__pyx_v_resultp;
16888  char *__pyx_r;
16889  __Pyx_RefNannyDeclarations
16890  Py_ssize_t __pyx_t_1;
16891  int __pyx_t_2;
16892  PyObject *__pyx_t_3 = NULL;
16893  PyObject *__pyx_t_4 = NULL;
16894  __Pyx_RefNannySetupContext("pybuffer_index", 0);
16895 
16896  /* "View.MemoryView":912
16897  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
16898  * Py_ssize_t dim) except NULL:
16899  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
16900  * cdef Py_ssize_t itemsize = view.itemsize
16901  * cdef char *resultp
16902  */
16903  __pyx_v_suboffset = -1L;
16904 
16905  /* "View.MemoryView":913
16906  * Py_ssize_t dim) except NULL:
16907  * cdef Py_ssize_t shape, stride, suboffset = -1
16908  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
16909  * cdef char *resultp
16910  *
16911  */
16912  __pyx_t_1 = __pyx_v_view->itemsize;
16913  __pyx_v_itemsize = __pyx_t_1;
16914 
16915  /* "View.MemoryView":916
16916  * cdef char *resultp
16917  *
16918  * if view.ndim == 0: # <<<<<<<<<<<<<<
16919  * shape = view.len / itemsize
16920  * stride = itemsize
16921  */
16922  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16923  if (__pyx_t_2) {
16924 
16925  /* "View.MemoryView":917
16926  *
16927  * if view.ndim == 0:
16928  * shape = view.len / itemsize # <<<<<<<<<<<<<<
16929  * stride = itemsize
16930  * else:
16931  */
16932  if (unlikely(__pyx_v_itemsize == 0)) {
16933  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
16934  __PYX_ERR(1, 917, __pyx_L1_error)
16935  }
16936  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
16937  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
16938  __PYX_ERR(1, 917, __pyx_L1_error)
16939  }
16940  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
16941 
16942  /* "View.MemoryView":918
16943  * if view.ndim == 0:
16944  * shape = view.len / itemsize
16945  * stride = itemsize # <<<<<<<<<<<<<<
16946  * else:
16947  * shape = view.shape[dim]
16948  */
16949  __pyx_v_stride = __pyx_v_itemsize;
16950 
16951  /* "View.MemoryView":916
16952  * cdef char *resultp
16953  *
16954  * if view.ndim == 0: # <<<<<<<<<<<<<<
16955  * shape = view.len / itemsize
16956  * stride = itemsize
16957  */
16958  goto __pyx_L3;
16959  }
16960 
16961  /* "View.MemoryView":920
16962  * stride = itemsize
16963  * else:
16964  * shape = view.shape[dim] # <<<<<<<<<<<<<<
16965  * stride = view.strides[dim]
16966  * if view.suboffsets != NULL:
16967  */
16968  /*else*/ {
16969  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16970 
16971  /* "View.MemoryView":921
16972  * else:
16973  * shape = view.shape[dim]
16974  * stride = view.strides[dim] # <<<<<<<<<<<<<<
16975  * if view.suboffsets != NULL:
16976  * suboffset = view.suboffsets[dim]
16977  */
16978  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16979 
16980  /* "View.MemoryView":922
16981  * shape = view.shape[dim]
16982  * stride = view.strides[dim]
16983  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16984  * suboffset = view.suboffsets[dim]
16985  *
16986  */
16987  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16988  if (__pyx_t_2) {
16989 
16990  /* "View.MemoryView":923
16991  * stride = view.strides[dim]
16992  * if view.suboffsets != NULL:
16993  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
16994  *
16995  * if index < 0:
16996  */
16997  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16998 
16999  /* "View.MemoryView":922
17000  * shape = view.shape[dim]
17001  * stride = view.strides[dim]
17002  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
17003  * suboffset = view.suboffsets[dim]
17004  *
17005  */
17006  }
17007  }
17008  __pyx_L3:;
17009 
17010  /* "View.MemoryView":925
17011  * suboffset = view.suboffsets[dim]
17012  *
17013  * if index < 0: # <<<<<<<<<<<<<<
17014  * index += view.shape[dim]
17015  * if index < 0:
17016  */
17017  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17018  if (__pyx_t_2) {
17019 
17020  /* "View.MemoryView":926
17021  *
17022  * if index < 0:
17023  * index += view.shape[dim] # <<<<<<<<<<<<<<
17024  * if index < 0:
17025  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17026  */
17027  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
17028 
17029  /* "View.MemoryView":927
17030  * if index < 0:
17031  * index += view.shape[dim]
17032  * if index < 0: # <<<<<<<<<<<<<<
17033  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17034  *
17035  */
17036  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17037  if (unlikely(__pyx_t_2)) {
17038 
17039  /* "View.MemoryView":928
17040  * index += view.shape[dim]
17041  * if index < 0:
17042  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17043  *
17044  * if index >= shape:
17045  */
17046  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
17047  __Pyx_GOTREF(__pyx_t_3);
17048  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
17049  __Pyx_GOTREF(__pyx_t_4);
17050  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17051  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
17052  __Pyx_GOTREF(__pyx_t_3);
17053  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17054  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17055  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17056  __PYX_ERR(1, 928, __pyx_L1_error)
17057 
17058  /* "View.MemoryView":927
17059  * if index < 0:
17060  * index += view.shape[dim]
17061  * if index < 0: # <<<<<<<<<<<<<<
17062  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17063  *
17064  */
17065  }
17066 
17067  /* "View.MemoryView":925
17068  * suboffset = view.suboffsets[dim]
17069  *
17070  * if index < 0: # <<<<<<<<<<<<<<
17071  * index += view.shape[dim]
17072  * if index < 0:
17073  */
17074  }
17075 
17076  /* "View.MemoryView":930
17077  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17078  *
17079  * if index >= shape: # <<<<<<<<<<<<<<
17080  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17081  *
17082  */
17083  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
17084  if (unlikely(__pyx_t_2)) {
17085 
17086  /* "View.MemoryView":931
17087  *
17088  * if index >= shape:
17089  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17090  *
17091  * resultp = bufp + index * stride
17092  */
17093  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
17094  __Pyx_GOTREF(__pyx_t_3);
17095  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
17096  __Pyx_GOTREF(__pyx_t_4);
17097  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17098  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
17099  __Pyx_GOTREF(__pyx_t_3);
17100  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17101  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17102  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17103  __PYX_ERR(1, 931, __pyx_L1_error)
17104 
17105  /* "View.MemoryView":930
17106  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17107  *
17108  * if index >= shape: # <<<<<<<<<<<<<<
17109  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17110  *
17111  */
17112  }
17113 
17114  /* "View.MemoryView":933
17115  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17116  *
17117  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
17118  * if suboffset >= 0:
17119  * resultp = (<char **> resultp)[0] + suboffset
17120  */
17121  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
17122 
17123  /* "View.MemoryView":934
17124  *
17125  * resultp = bufp + index * stride
17126  * if suboffset >= 0: # <<<<<<<<<<<<<<
17127  * resultp = (<char **> resultp)[0] + suboffset
17128  *
17129  */
17130  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17131  if (__pyx_t_2) {
17132 
17133  /* "View.MemoryView":935
17134  * resultp = bufp + index * stride
17135  * if suboffset >= 0:
17136  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
17137  *
17138  * return resultp
17139  */
17140  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
17141 
17142  /* "View.MemoryView":934
17143  *
17144  * resultp = bufp + index * stride
17145  * if suboffset >= 0: # <<<<<<<<<<<<<<
17146  * resultp = (<char **> resultp)[0] + suboffset
17147  *
17148  */
17149  }
17150 
17151  /* "View.MemoryView":937
17152  * resultp = (<char **> resultp)[0] + suboffset
17153  *
17154  * return resultp # <<<<<<<<<<<<<<
17155  *
17156  *
17157  */
17158  __pyx_r = __pyx_v_resultp;
17159  goto __pyx_L0;
17160 
17161  /* "View.MemoryView":910
17162  *
17163  * @cname('__pyx_pybuffer_index')
17164  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
17165  * Py_ssize_t dim) except NULL:
17166  * cdef Py_ssize_t shape, stride, suboffset = -1
17167  */
17168 
17169  /* function exit code */
17170  __pyx_L1_error:;
17171  __Pyx_XDECREF(__pyx_t_3);
17172  __Pyx_XDECREF(__pyx_t_4);
17173  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
17174  __pyx_r = NULL;
17175  __pyx_L0:;
17176  __Pyx_RefNannyFinishContext();
17177  return __pyx_r;
17178 }
17179 
17180 /* "View.MemoryView":943
17181  *
17182  * @cname('__pyx_memslice_transpose')
17183  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17184  * cdef int ndim = memslice.memview.view.ndim
17185  *
17186  */
17187 
17188 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
17189  int __pyx_v_ndim;
17190  Py_ssize_t *__pyx_v_shape;
17191  Py_ssize_t *__pyx_v_strides;
17192  int __pyx_v_i;
17193  int __pyx_v_j;
17194  int __pyx_r;
17195  int __pyx_t_1;
17196  Py_ssize_t *__pyx_t_2;
17197  long __pyx_t_3;
17198  long __pyx_t_4;
17199  Py_ssize_t __pyx_t_5;
17200  Py_ssize_t __pyx_t_6;
17201  int __pyx_t_7;
17202  int __pyx_t_8;
17203  int __pyx_t_9;
17204 
17205  /* "View.MemoryView":944
17206  * @cname('__pyx_memslice_transpose')
17207  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
17208  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
17209  *
17210  * cdef Py_ssize_t *shape = memslice.shape
17211  */
17212  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
17213  __pyx_v_ndim = __pyx_t_1;
17214 
17215  /* "View.MemoryView":946
17216  * cdef int ndim = memslice.memview.view.ndim
17217  *
17218  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
17219  * cdef Py_ssize_t *strides = memslice.strides
17220  *
17221  */
17222  __pyx_t_2 = __pyx_v_memslice->shape;
17223  __pyx_v_shape = __pyx_t_2;
17224 
17225  /* "View.MemoryView":947
17226  *
17227  * cdef Py_ssize_t *shape = memslice.shape
17228  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
17229  *
17230  *
17231  */
17232  __pyx_t_2 = __pyx_v_memslice->strides;
17233  __pyx_v_strides = __pyx_t_2;
17234 
17235  /* "View.MemoryView":951
17236  *
17237  * cdef int i, j
17238  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
17239  * j = ndim - 1 - i
17240  * strides[i], strides[j] = strides[j], strides[i]
17241  */
17242  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
17243  __pyx_t_4 = __pyx_t_3;
17244  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
17245  __pyx_v_i = __pyx_t_1;
17246 
17247  /* "View.MemoryView":952
17248  * cdef int i, j
17249  * for i in range(ndim / 2):
17250  * j = ndim - 1 - i # <<<<<<<<<<<<<<
17251  * strides[i], strides[j] = strides[j], strides[i]
17252  * shape[i], shape[j] = shape[j], shape[i]
17253  */
17254  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17255 
17256  /* "View.MemoryView":953
17257  * for i in range(ndim / 2):
17258  * j = ndim - 1 - i
17259  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
17260  * shape[i], shape[j] = shape[j], shape[i]
17261  *
17262  */
17263  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17264  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17265  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17266  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17267 
17268  /* "View.MemoryView":954
17269  * j = ndim - 1 - i
17270  * strides[i], strides[j] = strides[j], strides[i]
17271  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
17272  *
17273  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17274  */
17275  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17276  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17277  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17278  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17279 
17280  /* "View.MemoryView":956
17281  * shape[i], shape[j] = shape[j], shape[i]
17282  *
17283  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17284  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17285  *
17286  */
17287  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17288  if (!__pyx_t_8) {
17289  } else {
17290  __pyx_t_7 = __pyx_t_8;
17291  goto __pyx_L6_bool_binop_done;
17292  }
17293  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17294  __pyx_t_7 = __pyx_t_8;
17295  __pyx_L6_bool_binop_done:;
17296  if (__pyx_t_7) {
17297 
17298  /* "View.MemoryView":957
17299  *
17300  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17301  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
17302  *
17303  * return 1
17304  */
17305  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
17306 
17307  /* "View.MemoryView":956
17308  * shape[i], shape[j] = shape[j], shape[i]
17309  *
17310  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17311  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17312  *
17313  */
17314  }
17315  }
17316 
17317  /* "View.MemoryView":959
17318  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17319  *
17320  * return 1 # <<<<<<<<<<<<<<
17321  *
17322  *
17323  */
17324  __pyx_r = 1;
17325  goto __pyx_L0;
17326 
17327  /* "View.MemoryView":943
17328  *
17329  * @cname('__pyx_memslice_transpose')
17330  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17331  * cdef int ndim = memslice.memview.view.ndim
17332  *
17333  */
17334 
17335  /* function exit code */
17336  __pyx_L1_error:;
17337  {
17338  #ifdef WITH_THREAD
17339  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17340  #endif
17341  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17342  #ifdef WITH_THREAD
17343  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17344  #endif
17345  }
17346  __pyx_r = 0;
17347  __pyx_L0:;
17348  return __pyx_r;
17349 }
17350 
17351 /* "View.MemoryView":976
17352  * cdef int (*to_dtype_func)(char *, object) except 0
17353  *
17354  * def __dealloc__(self): # <<<<<<<<<<<<<<
17355  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17356  *
17357  */
17358 
17359 /* Python wrapper */
17360 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
17361 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17362  __Pyx_RefNannyDeclarations
17363  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
17364  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17365 
17366  /* function exit code */
17367  __Pyx_RefNannyFinishContext();
17368 }
17369 
17370 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17371  __Pyx_RefNannyDeclarations
17372  __Pyx_RefNannySetupContext("__dealloc__", 0);
17373 
17374  /* "View.MemoryView":977
17375  *
17376  * def __dealloc__(self):
17377  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
17378  *
17379  * cdef convert_item_to_object(self, char *itemp):
17380  */
17381  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17382 
17383  /* "View.MemoryView":976
17384  * cdef int (*to_dtype_func)(char *, object) except 0
17385  *
17386  * def __dealloc__(self): # <<<<<<<<<<<<<<
17387  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17388  *
17389  */
17390 
17391  /* function exit code */
17392  __Pyx_RefNannyFinishContext();
17393 }
17394 
17395 /* "View.MemoryView":979
17396  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17397  *
17398  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17399  * if self.to_object_func != NULL:
17400  * return self.to_object_func(itemp)
17401  */
17402 
17403 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
17404  PyObject *__pyx_r = NULL;
17405  __Pyx_RefNannyDeclarations
17406  int __pyx_t_1;
17407  PyObject *__pyx_t_2 = NULL;
17408  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
17409 
17410  /* "View.MemoryView":980
17411  *
17412  * cdef convert_item_to_object(self, char *itemp):
17413  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17414  * return self.to_object_func(itemp)
17415  * else:
17416  */
17417  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17418  if (__pyx_t_1) {
17419 
17420  /* "View.MemoryView":981
17421  * cdef convert_item_to_object(self, char *itemp):
17422  * if self.to_object_func != NULL:
17423  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
17424  * else:
17425  * return memoryview.convert_item_to_object(self, itemp)
17426  */
17427  __Pyx_XDECREF(__pyx_r);
17428  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
17429  __Pyx_GOTREF(__pyx_t_2);
17430  __pyx_r = __pyx_t_2;
17431  __pyx_t_2 = 0;
17432  goto __pyx_L0;
17433 
17434  /* "View.MemoryView":980
17435  *
17436  * cdef convert_item_to_object(self, char *itemp):
17437  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17438  * return self.to_object_func(itemp)
17439  * else:
17440  */
17441  }
17442 
17443  /* "View.MemoryView":983
17444  * return self.to_object_func(itemp)
17445  * else:
17446  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
17447  *
17448  * cdef assign_item_from_object(self, char *itemp, object value):
17449  */
17450  /*else*/ {
17451  __Pyx_XDECREF(__pyx_r);
17452  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
17453  __Pyx_GOTREF(__pyx_t_2);
17454  __pyx_r = __pyx_t_2;
17455  __pyx_t_2 = 0;
17456  goto __pyx_L0;
17457  }
17458 
17459  /* "View.MemoryView":979
17460  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17461  *
17462  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17463  * if self.to_object_func != NULL:
17464  * return self.to_object_func(itemp)
17465  */
17466 
17467  /* function exit code */
17468  __pyx_L1_error:;
17469  __Pyx_XDECREF(__pyx_t_2);
17470  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17471  __pyx_r = 0;
17472  __pyx_L0:;
17473  __Pyx_XGIVEREF(__pyx_r);
17474  __Pyx_RefNannyFinishContext();
17475  return __pyx_r;
17476 }
17477 
17478 /* "View.MemoryView":985
17479  * return memoryview.convert_item_to_object(self, itemp)
17480  *
17481  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17482  * if self.to_dtype_func != NULL:
17483  * self.to_dtype_func(itemp, value)
17484  */
17485 
17486 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17487  PyObject *__pyx_r = NULL;
17488  __Pyx_RefNannyDeclarations
17489  int __pyx_t_1;
17490  int __pyx_t_2;
17491  PyObject *__pyx_t_3 = NULL;
17492  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
17493 
17494  /* "View.MemoryView":986
17495  *
17496  * cdef assign_item_from_object(self, char *itemp, object value):
17497  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17498  * self.to_dtype_func(itemp, value)
17499  * else:
17500  */
17501  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17502  if (__pyx_t_1) {
17503 
17504  /* "View.MemoryView":987
17505  * cdef assign_item_from_object(self, char *itemp, object value):
17506  * if self.to_dtype_func != NULL:
17507  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
17508  * else:
17509  * memoryview.assign_item_from_object(self, itemp, value)
17510  */
17511  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
17512 
17513  /* "View.MemoryView":986
17514  *
17515  * cdef assign_item_from_object(self, char *itemp, object value):
17516  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17517  * self.to_dtype_func(itemp, value)
17518  * else:
17519  */
17520  goto __pyx_L3;
17521  }
17522 
17523  /* "View.MemoryView":989
17524  * self.to_dtype_func(itemp, value)
17525  * else:
17526  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
17527  *
17528  * @property
17529  */
17530  /*else*/ {
17531  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
17532  __Pyx_GOTREF(__pyx_t_3);
17533  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17534  }
17535  __pyx_L3:;
17536 
17537  /* "View.MemoryView":985
17538  * return memoryview.convert_item_to_object(self, itemp)
17539  *
17540  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17541  * if self.to_dtype_func != NULL:
17542  * self.to_dtype_func(itemp, value)
17543  */
17544 
17545  /* function exit code */
17546  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17547  goto __pyx_L0;
17548  __pyx_L1_error:;
17549  __Pyx_XDECREF(__pyx_t_3);
17550  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17551  __pyx_r = 0;
17552  __pyx_L0:;
17553  __Pyx_XGIVEREF(__pyx_r);
17554  __Pyx_RefNannyFinishContext();
17555  return __pyx_r;
17556 }
17557 
17558 /* "View.MemoryView":992
17559  *
17560  * @property
17561  * def base(self): # <<<<<<<<<<<<<<
17562  * return self.from_object
17563  *
17564  */
17565 
17566 /* Python wrapper */
17567 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
17568 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17569  PyObject *__pyx_r = 0;
17570  __Pyx_RefNannyDeclarations
17571  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17572  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17573 
17574  /* function exit code */
17575  __Pyx_RefNannyFinishContext();
17576  return __pyx_r;
17577 }
17578 
17579 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17580  PyObject *__pyx_r = NULL;
17581  __Pyx_RefNannyDeclarations
17582  __Pyx_RefNannySetupContext("__get__", 0);
17583 
17584  /* "View.MemoryView":993
17585  * @property
17586  * def base(self):
17587  * return self.from_object # <<<<<<<<<<<<<<
17588  *
17589  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
17590  */
17591  __Pyx_XDECREF(__pyx_r);
17592  __Pyx_INCREF(__pyx_v_self->from_object);
17593  __pyx_r = __pyx_v_self->from_object;
17594  goto __pyx_L0;
17595 
17596  /* "View.MemoryView":992
17597  *
17598  * @property
17599  * def base(self): # <<<<<<<<<<<<<<
17600  * return self.from_object
17601  *
17602  */
17603 
17604  /* function exit code */
17605  __pyx_L0:;
17606  __Pyx_XGIVEREF(__pyx_r);
17607  __Pyx_RefNannyFinishContext();
17608  return __pyx_r;
17609 }
17610 
17611 /* "(tree fragment)":1
17612  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17613  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17614  * def __setstate_cython__(self, __pyx_state):
17615  */
17616 
17617 /* Python wrapper */
17618 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17619 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17620  PyObject *__pyx_r = 0;
17621  __Pyx_RefNannyDeclarations
17622  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
17623  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17624 
17625  /* function exit code */
17626  __Pyx_RefNannyFinishContext();
17627  return __pyx_r;
17628 }
17629 
17630 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17631  PyObject *__pyx_r = NULL;
17632  __Pyx_RefNannyDeclarations
17633  PyObject *__pyx_t_1 = NULL;
17634  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
17635 
17636  /* "(tree fragment)":2
17637  * def __reduce_cython__(self):
17638  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17639  * def __setstate_cython__(self, __pyx_state):
17640  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17641  */
17642  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17643  __Pyx_GOTREF(__pyx_t_1);
17644  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17645  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17646  __PYX_ERR(1, 2, __pyx_L1_error)
17647 
17648  /* "(tree fragment)":1
17649  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17650  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17651  * def __setstate_cython__(self, __pyx_state):
17652  */
17653 
17654  /* function exit code */
17655  __pyx_L1_error:;
17656  __Pyx_XDECREF(__pyx_t_1);
17657  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17658  __pyx_r = NULL;
17659  __Pyx_XGIVEREF(__pyx_r);
17660  __Pyx_RefNannyFinishContext();
17661  return __pyx_r;
17662 }
17663 
17664 /* "(tree fragment)":3
17665  * def __reduce_cython__(self):
17666  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17667  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17668  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17669  */
17670 
17671 /* Python wrapper */
17672 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
17673 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17674  PyObject *__pyx_r = 0;
17675  __Pyx_RefNannyDeclarations
17676  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
17677  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17678 
17679  /* function exit code */
17680  __Pyx_RefNannyFinishContext();
17681  return __pyx_r;
17682 }
17683 
17684 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17685  PyObject *__pyx_r = NULL;
17686  __Pyx_RefNannyDeclarations
17687  PyObject *__pyx_t_1 = NULL;
17688  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
17689 
17690  /* "(tree fragment)":4
17691  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17692  * def __setstate_cython__(self, __pyx_state):
17693  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17694  */
17695  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17696  __Pyx_GOTREF(__pyx_t_1);
17697  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17698  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17699  __PYX_ERR(1, 4, __pyx_L1_error)
17700 
17701  /* "(tree fragment)":3
17702  * def __reduce_cython__(self):
17703  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17704  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17705  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17706  */
17707 
17708  /* function exit code */
17709  __pyx_L1_error:;
17710  __Pyx_XDECREF(__pyx_t_1);
17711  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17712  __pyx_r = NULL;
17713  __Pyx_XGIVEREF(__pyx_r);
17714  __Pyx_RefNannyFinishContext();
17715  return __pyx_r;
17716 }
17717 
17718 /* "View.MemoryView":999
17719  *
17720  * @cname('__pyx_memoryview_fromslice')
17721  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17722  * int ndim,
17723  * object (*to_object_func)(char *),
17724  */
17725 
17726 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
17727  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17728  Py_ssize_t __pyx_v_suboffset;
17729  PyObject *__pyx_v_length = NULL;
17730  PyObject *__pyx_r = NULL;
17731  __Pyx_RefNannyDeclarations
17732  int __pyx_t_1;
17733  PyObject *__pyx_t_2 = NULL;
17734  PyObject *__pyx_t_3 = NULL;
17735  __Pyx_TypeInfo *__pyx_t_4;
17736  Py_buffer __pyx_t_5;
17737  Py_ssize_t *__pyx_t_6;
17738  Py_ssize_t *__pyx_t_7;
17739  Py_ssize_t *__pyx_t_8;
17740  Py_ssize_t __pyx_t_9;
17741  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
17742 
17743  /* "View.MemoryView":1007
17744  * cdef _memoryviewslice result
17745  *
17746  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17747  * return None
17748  *
17749  */
17750  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17751  if (__pyx_t_1) {
17752 
17753  /* "View.MemoryView":1008
17754  *
17755  * if <PyObject *> memviewslice.memview == Py_None:
17756  * return None # <<<<<<<<<<<<<<
17757  *
17758  *
17759  */
17760  __Pyx_XDECREF(__pyx_r);
17761  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17762  goto __pyx_L0;
17763 
17764  /* "View.MemoryView":1007
17765  * cdef _memoryviewslice result
17766  *
17767  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17768  * return None
17769  *
17770  */
17771  }
17772 
17773  /* "View.MemoryView":1013
17774  *
17775  *
17776  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
17777  *
17778  * result.from_slice = memviewslice
17779  */
17780  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17781  __Pyx_GOTREF(__pyx_t_2);
17782  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
17783  __Pyx_GOTREF(__pyx_t_3);
17784  __Pyx_INCREF(Py_None);
17785  __Pyx_GIVEREF(Py_None);
17786  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17787  __Pyx_INCREF(__pyx_int_0);
17788  __Pyx_GIVEREF(__pyx_int_0);
17789  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17790  __Pyx_GIVEREF(__pyx_t_2);
17791  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17792  __pyx_t_2 = 0;
17793  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17794  __Pyx_GOTREF(__pyx_t_2);
17795  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17796  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17797  __pyx_t_2 = 0;
17798 
17799  /* "View.MemoryView":1015
17800  * result = _memoryviewslice(None, 0, dtype_is_object)
17801  *
17802  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
17803  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17804  *
17805  */
17806  __pyx_v_result->from_slice = __pyx_v_memviewslice;
17807 
17808  /* "View.MemoryView":1016
17809  *
17810  * result.from_slice = memviewslice
17811  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
17812  *
17813  * result.from_object = (<memoryview> memviewslice.memview).base
17814  */
17815  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17816 
17817  /* "View.MemoryView":1018
17818  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17819  *
17820  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
17821  * result.typeinfo = memviewslice.memview.typeinfo
17822  *
17823  */
17824  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
17825  __Pyx_GOTREF(__pyx_t_2);
17826  __Pyx_GIVEREF(__pyx_t_2);
17827  __Pyx_GOTREF(__pyx_v_result->from_object);
17828  __Pyx_DECREF(__pyx_v_result->from_object);
17829  __pyx_v_result->from_object = __pyx_t_2;
17830  __pyx_t_2 = 0;
17831 
17832  /* "View.MemoryView":1019
17833  *
17834  * result.from_object = (<memoryview> memviewslice.memview).base
17835  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
17836  *
17837  * result.view = memviewslice.memview.view
17838  */
17839  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17840  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17841 
17842  /* "View.MemoryView":1021
17843  * result.typeinfo = memviewslice.memview.typeinfo
17844  *
17845  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
17846  * result.view.buf = <void *> memviewslice.data
17847  * result.view.ndim = ndim
17848  */
17849  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17850  __pyx_v_result->__pyx_base.view = __pyx_t_5;
17851 
17852  /* "View.MemoryView":1022
17853  *
17854  * result.view = memviewslice.memview.view
17855  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
17856  * result.view.ndim = ndim
17857  * (<__pyx_buffer *> &result.view).obj = Py_None
17858  */
17859  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
17860 
17861  /* "View.MemoryView":1023
17862  * result.view = memviewslice.memview.view
17863  * result.view.buf = <void *> memviewslice.data
17864  * result.view.ndim = ndim # <<<<<<<<<<<<<<
17865  * (<__pyx_buffer *> &result.view).obj = Py_None
17866  * Py_INCREF(Py_None)
17867  */
17868  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17869 
17870  /* "View.MemoryView":1024
17871  * result.view.buf = <void *> memviewslice.data
17872  * result.view.ndim = ndim
17873  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
17874  * Py_INCREF(Py_None)
17875  *
17876  */
17877  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17878 
17879  /* "View.MemoryView":1025
17880  * result.view.ndim = ndim
17881  * (<__pyx_buffer *> &result.view).obj = Py_None
17882  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
17883  *
17884  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17885  */
17886  Py_INCREF(Py_None);
17887 
17888  /* "View.MemoryView":1027
17889  * Py_INCREF(Py_None)
17890  *
17891  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17892  * result.flags = PyBUF_RECORDS
17893  * else:
17894  */
17895  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17896  if (__pyx_t_1) {
17897 
17898  /* "View.MemoryView":1028
17899  *
17900  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17901  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
17902  * else:
17903  * result.flags = PyBUF_RECORDS_RO
17904  */
17905  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17906 
17907  /* "View.MemoryView":1027
17908  * Py_INCREF(Py_None)
17909  *
17910  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17911  * result.flags = PyBUF_RECORDS
17912  * else:
17913  */
17914  goto __pyx_L4;
17915  }
17916 
17917  /* "View.MemoryView":1030
17918  * result.flags = PyBUF_RECORDS
17919  * else:
17920  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
17921  *
17922  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17923  */
17924  /*else*/ {
17925  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17926  }
17927  __pyx_L4:;
17928 
17929  /* "View.MemoryView":1032
17930  * result.flags = PyBUF_RECORDS_RO
17931  *
17932  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
17933  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
17934  *
17935  */
17936  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17937 
17938  /* "View.MemoryView":1033
17939  *
17940  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17941  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
17942  *
17943  *
17944  */
17945  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17946 
17947  /* "View.MemoryView":1036
17948  *
17949  *
17950  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
17951  * for suboffset in result.from_slice.suboffsets[:ndim]:
17952  * if suboffset >= 0:
17953  */
17954  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17955 
17956  /* "View.MemoryView":1037
17957  *
17958  * result.view.suboffsets = NULL
17959  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
17960  * if suboffset >= 0:
17961  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17962  */
17963  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17964  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17965  __pyx_t_6 = __pyx_t_8;
17966  __pyx_v_suboffset = (__pyx_t_6[0]);
17967 
17968  /* "View.MemoryView":1038
17969  * result.view.suboffsets = NULL
17970  * for suboffset in result.from_slice.suboffsets[:ndim]:
17971  * if suboffset >= 0: # <<<<<<<<<<<<<<
17972  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17973  * break
17974  */
17975  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17976  if (__pyx_t_1) {
17977 
17978  /* "View.MemoryView":1039
17979  * for suboffset in result.from_slice.suboffsets[:ndim]:
17980  * if suboffset >= 0:
17981  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
17982  * break
17983  *
17984  */
17985  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17986 
17987  /* "View.MemoryView":1040
17988  * if suboffset >= 0:
17989  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17990  * break # <<<<<<<<<<<<<<
17991  *
17992  * result.view.len = result.view.itemsize
17993  */
17994  goto __pyx_L6_break;
17995 
17996  /* "View.MemoryView":1038
17997  * result.view.suboffsets = NULL
17998  * for suboffset in result.from_slice.suboffsets[:ndim]:
17999  * if suboffset >= 0: # <<<<<<<<<<<<<<
18000  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18001  * break
18002  */
18003  }
18004  }
18005  __pyx_L6_break:;
18006 
18007  /* "View.MemoryView":1042
18008  * break
18009  *
18010  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
18011  * for length in result.view.shape[:ndim]:
18012  * result.view.len *= length
18013  */
18014  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
18015  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18016 
18017  /* "View.MemoryView":1043
18018  *
18019  * result.view.len = result.view.itemsize
18020  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
18021  * result.view.len *= length
18022  *
18023  */
18024  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
18025  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18026  __pyx_t_6 = __pyx_t_8;
18027  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
18028  __Pyx_GOTREF(__pyx_t_2);
18029  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
18030  __pyx_t_2 = 0;
18031 
18032  /* "View.MemoryView":1044
18033  * result.view.len = result.view.itemsize
18034  * for length in result.view.shape[:ndim]:
18035  * result.view.len *= length # <<<<<<<<<<<<<<
18036  *
18037  * result.to_object_func = to_object_func
18038  */
18039  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
18040  __Pyx_GOTREF(__pyx_t_2);
18041  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
18042  __Pyx_GOTREF(__pyx_t_3);
18043  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18044  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
18045  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18046  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18047  }
18048 
18049  /* "View.MemoryView":1046
18050  * result.view.len *= length
18051  *
18052  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
18053  * result.to_dtype_func = to_dtype_func
18054  *
18055  */
18056  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
18057 
18058  /* "View.MemoryView":1047
18059  *
18060  * result.to_object_func = to_object_func
18061  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
18062  *
18063  * return result
18064  */
18065  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
18066 
18067  /* "View.MemoryView":1049
18068  * result.to_dtype_func = to_dtype_func
18069  *
18070  * return result # <<<<<<<<<<<<<<
18071  *
18072  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18073  */
18074  __Pyx_XDECREF(__pyx_r);
18075  __Pyx_INCREF(((PyObject *)__pyx_v_result));
18076  __pyx_r = ((PyObject *)__pyx_v_result);
18077  goto __pyx_L0;
18078 
18079  /* "View.MemoryView":999
18080  *
18081  * @cname('__pyx_memoryview_fromslice')
18082  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
18083  * int ndim,
18084  * object (*to_object_func)(char *),
18085  */
18086 
18087  /* function exit code */
18088  __pyx_L1_error:;
18089  __Pyx_XDECREF(__pyx_t_2);
18090  __Pyx_XDECREF(__pyx_t_3);
18091  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18092  __pyx_r = 0;
18093  __pyx_L0:;
18094  __Pyx_XDECREF((PyObject *)__pyx_v_result);
18095  __Pyx_XDECREF(__pyx_v_length);
18096  __Pyx_XGIVEREF(__pyx_r);
18097  __Pyx_RefNannyFinishContext();
18098  return __pyx_r;
18099 }
18100 
18101 /* "View.MemoryView":1052
18102  *
18103  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18104  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18105  * __Pyx_memviewslice *mslice) except NULL:
18106  * cdef _memoryviewslice obj
18107  */
18108 
18109 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
18110  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
18111  __Pyx_memviewslice *__pyx_r;
18112  __Pyx_RefNannyDeclarations
18113  int __pyx_t_1;
18114  int __pyx_t_2;
18115  PyObject *__pyx_t_3 = NULL;
18116  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
18117 
18118  /* "View.MemoryView":1055
18119  * __Pyx_memviewslice *mslice) except NULL:
18120  * cdef _memoryviewslice obj
18121  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18122  * obj = memview
18123  * return &obj.from_slice
18124  */
18125  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18126  __pyx_t_2 = (__pyx_t_1 != 0);
18127  if (__pyx_t_2) {
18128 
18129  /* "View.MemoryView":1056
18130  * cdef _memoryviewslice obj
18131  * if isinstance(memview, _memoryviewslice):
18132  * obj = memview # <<<<<<<<<<<<<<
18133  * return &obj.from_slice
18134  * else:
18135  */
18136  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
18137  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18138  __Pyx_INCREF(__pyx_t_3);
18139  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18140  __pyx_t_3 = 0;
18141 
18142  /* "View.MemoryView":1057
18143  * if isinstance(memview, _memoryviewslice):
18144  * obj = memview
18145  * return &obj.from_slice # <<<<<<<<<<<<<<
18146  * else:
18147  * slice_copy(memview, mslice)
18148  */
18149  __pyx_r = (&__pyx_v_obj->from_slice);
18150  goto __pyx_L0;
18151 
18152  /* "View.MemoryView":1055
18153  * __Pyx_memviewslice *mslice) except NULL:
18154  * cdef _memoryviewslice obj
18155  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18156  * obj = memview
18157  * return &obj.from_slice
18158  */
18159  }
18160 
18161  /* "View.MemoryView":1059
18162  * return &obj.from_slice
18163  * else:
18164  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
18165  * return mslice
18166  *
18167  */
18168  /*else*/ {
18169  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
18170 
18171  /* "View.MemoryView":1060
18172  * else:
18173  * slice_copy(memview, mslice)
18174  * return mslice # <<<<<<<<<<<<<<
18175  *
18176  * @cname('__pyx_memoryview_slice_copy')
18177  */
18178  __pyx_r = __pyx_v_mslice;
18179  goto __pyx_L0;
18180  }
18181 
18182  /* "View.MemoryView":1052
18183  *
18184  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18185  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18186  * __Pyx_memviewslice *mslice) except NULL:
18187  * cdef _memoryviewslice obj
18188  */
18189 
18190  /* function exit code */
18191  __pyx_L1_error:;
18192  __Pyx_XDECREF(__pyx_t_3);
18193  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
18194  __pyx_r = NULL;
18195  __pyx_L0:;
18196  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18197  __Pyx_RefNannyFinishContext();
18198  return __pyx_r;
18199 }
18200 
18201 /* "View.MemoryView":1063
18202  *
18203  * @cname('__pyx_memoryview_slice_copy')
18204  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18205  * cdef int dim
18206  * cdef (Py_ssize_t*) shape, strides, suboffsets
18207  */
18208 
18209 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18210  int __pyx_v_dim;
18211  Py_ssize_t *__pyx_v_shape;
18212  Py_ssize_t *__pyx_v_strides;
18213  Py_ssize_t *__pyx_v_suboffsets;
18214  __Pyx_RefNannyDeclarations
18215  Py_ssize_t *__pyx_t_1;
18216  int __pyx_t_2;
18217  int __pyx_t_3;
18218  int __pyx_t_4;
18219  Py_ssize_t __pyx_t_5;
18220  __Pyx_RefNannySetupContext("slice_copy", 0);
18221 
18222  /* "View.MemoryView":1067
18223  * cdef (Py_ssize_t*) shape, strides, suboffsets
18224  *
18225  * shape = memview.view.shape # <<<<<<<<<<<<<<
18226  * strides = memview.view.strides
18227  * suboffsets = memview.view.suboffsets
18228  */
18229  __pyx_t_1 = __pyx_v_memview->view.shape;
18230  __pyx_v_shape = __pyx_t_1;
18231 
18232  /* "View.MemoryView":1068
18233  *
18234  * shape = memview.view.shape
18235  * strides = memview.view.strides # <<<<<<<<<<<<<<
18236  * suboffsets = memview.view.suboffsets
18237  *
18238  */
18239  __pyx_t_1 = __pyx_v_memview->view.strides;
18240  __pyx_v_strides = __pyx_t_1;
18241 
18242  /* "View.MemoryView":1069
18243  * shape = memview.view.shape
18244  * strides = memview.view.strides
18245  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
18246  *
18247  * dst.memview = <__pyx_memoryview *> memview
18248  */
18249  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18250  __pyx_v_suboffsets = __pyx_t_1;
18251 
18252  /* "View.MemoryView":1071
18253  * suboffsets = memview.view.suboffsets
18254  *
18255  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
18256  * dst.data = <char *> memview.view.buf
18257  *
18258  */
18259  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
18260 
18261  /* "View.MemoryView":1072
18262  *
18263  * dst.memview = <__pyx_memoryview *> memview
18264  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
18265  *
18266  * for dim in range(memview.view.ndim):
18267  */
18268  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
18269 
18270  /* "View.MemoryView":1074
18271  * dst.data = <char *> memview.view.buf
18272  *
18273  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
18274  * dst.shape[dim] = shape[dim]
18275  * dst.strides[dim] = strides[dim]
18276  */
18277  __pyx_t_2 = __pyx_v_memview->view.ndim;
18278  __pyx_t_3 = __pyx_t_2;
18279  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18280  __pyx_v_dim = __pyx_t_4;
18281 
18282  /* "View.MemoryView":1075
18283  *
18284  * for dim in range(memview.view.ndim):
18285  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
18286  * dst.strides[dim] = strides[dim]
18287  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18288  */
18289  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18290 
18291  /* "View.MemoryView":1076
18292  * for dim in range(memview.view.ndim):
18293  * dst.shape[dim] = shape[dim]
18294  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
18295  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18296  *
18297  */
18298  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18299 
18300  /* "View.MemoryView":1077
18301  * dst.shape[dim] = shape[dim]
18302  * dst.strides[dim] = strides[dim]
18303  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
18304  *
18305  * @cname('__pyx_memoryview_copy_object')
18306  */
18307  if ((__pyx_v_suboffsets != 0)) {
18308  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18309  } else {
18310  __pyx_t_5 = -1L;
18311  }
18312  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18313  }
18314 
18315  /* "View.MemoryView":1063
18316  *
18317  * @cname('__pyx_memoryview_slice_copy')
18318  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18319  * cdef int dim
18320  * cdef (Py_ssize_t*) shape, strides, suboffsets
18321  */
18322 
18323  /* function exit code */
18324  __Pyx_RefNannyFinishContext();
18325 }
18326 
18327 /* "View.MemoryView":1080
18328  *
18329  * @cname('__pyx_memoryview_copy_object')
18330  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18331  * "Create a new memoryview object"
18332  * cdef __Pyx_memviewslice memviewslice
18333  */
18334 
18335 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
18336  __Pyx_memviewslice __pyx_v_memviewslice;
18337  PyObject *__pyx_r = NULL;
18338  __Pyx_RefNannyDeclarations
18339  PyObject *__pyx_t_1 = NULL;
18340  __Pyx_RefNannySetupContext("memoryview_copy", 0);
18341 
18342  /* "View.MemoryView":1083
18343  * "Create a new memoryview object"
18344  * cdef __Pyx_memviewslice memviewslice
18345  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
18346  * return memoryview_copy_from_slice(memview, &memviewslice)
18347  *
18348  */
18349  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18350 
18351  /* "View.MemoryView":1084
18352  * cdef __Pyx_memviewslice memviewslice
18353  * slice_copy(memview, &memviewslice)
18354  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
18355  *
18356  * @cname('__pyx_memoryview_copy_object_from_slice')
18357  */
18358  __Pyx_XDECREF(__pyx_r);
18359  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
18360  __Pyx_GOTREF(__pyx_t_1);
18361  __pyx_r = __pyx_t_1;
18362  __pyx_t_1 = 0;
18363  goto __pyx_L0;
18364 
18365  /* "View.MemoryView":1080
18366  *
18367  * @cname('__pyx_memoryview_copy_object')
18368  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18369  * "Create a new memoryview object"
18370  * cdef __Pyx_memviewslice memviewslice
18371  */
18372 
18373  /* function exit code */
18374  __pyx_L1_error:;
18375  __Pyx_XDECREF(__pyx_t_1);
18376  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18377  __pyx_r = 0;
18378  __pyx_L0:;
18379  __Pyx_XGIVEREF(__pyx_r);
18380  __Pyx_RefNannyFinishContext();
18381  return __pyx_r;
18382 }
18383 
18384 /* "View.MemoryView":1087
18385  *
18386  * @cname('__pyx_memoryview_copy_object_from_slice')
18387  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18388  * """
18389  * Create a new memoryview object from a given memoryview object and slice.
18390  */
18391 
18392 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18393  PyObject *(*__pyx_v_to_object_func)(char *);
18394  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
18395  PyObject *__pyx_r = NULL;
18396  __Pyx_RefNannyDeclarations
18397  int __pyx_t_1;
18398  int __pyx_t_2;
18399  PyObject *(*__pyx_t_3)(char *);
18400  int (*__pyx_t_4)(char *, PyObject *);
18401  PyObject *__pyx_t_5 = NULL;
18402  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
18403 
18404  /* "View.MemoryView":1094
18405  * cdef int (*to_dtype_func)(char *, object) except 0
18406  *
18407  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18408  * to_object_func = (<_memoryviewslice> memview).to_object_func
18409  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18410  */
18411  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18412  __pyx_t_2 = (__pyx_t_1 != 0);
18413  if (__pyx_t_2) {
18414 
18415  /* "View.MemoryView":1095
18416  *
18417  * if isinstance(memview, _memoryviewslice):
18418  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
18419  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18420  * else:
18421  */
18422  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18423  __pyx_v_to_object_func = __pyx_t_3;
18424 
18425  /* "View.MemoryView":1096
18426  * if isinstance(memview, _memoryviewslice):
18427  * to_object_func = (<_memoryviewslice> memview).to_object_func
18428  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
18429  * else:
18430  * to_object_func = NULL
18431  */
18432  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18433  __pyx_v_to_dtype_func = __pyx_t_4;
18434 
18435  /* "View.MemoryView":1094
18436  * cdef int (*to_dtype_func)(char *, object) except 0
18437  *
18438  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18439  * to_object_func = (<_memoryviewslice> memview).to_object_func
18440  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18441  */
18442  goto __pyx_L3;
18443  }
18444 
18445  /* "View.MemoryView":1098
18446  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18447  * else:
18448  * to_object_func = NULL # <<<<<<<<<<<<<<
18449  * to_dtype_func = NULL
18450  *
18451  */
18452  /*else*/ {
18453  __pyx_v_to_object_func = NULL;
18454 
18455  /* "View.MemoryView":1099
18456  * else:
18457  * to_object_func = NULL
18458  * to_dtype_func = NULL # <<<<<<<<<<<<<<
18459  *
18460  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18461  */
18462  __pyx_v_to_dtype_func = NULL;
18463  }
18464  __pyx_L3:;
18465 
18466  /* "View.MemoryView":1101
18467  * to_dtype_func = NULL
18468  *
18469  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
18470  * to_object_func, to_dtype_func,
18471  * memview.dtype_is_object)
18472  */
18473  __Pyx_XDECREF(__pyx_r);
18474 
18475  /* "View.MemoryView":1103
18476  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18477  * to_object_func, to_dtype_func,
18478  * memview.dtype_is_object) # <<<<<<<<<<<<<<
18479  *
18480  *
18481  */
18482  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
18483  __Pyx_GOTREF(__pyx_t_5);
18484  __pyx_r = __pyx_t_5;
18485  __pyx_t_5 = 0;
18486  goto __pyx_L0;
18487 
18488  /* "View.MemoryView":1087
18489  *
18490  * @cname('__pyx_memoryview_copy_object_from_slice')
18491  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18492  * """
18493  * Create a new memoryview object from a given memoryview object and slice.
18494  */
18495 
18496  /* function exit code */
18497  __pyx_L1_error:;
18498  __Pyx_XDECREF(__pyx_t_5);
18499  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18500  __pyx_r = 0;
18501  __pyx_L0:;
18502  __Pyx_XGIVEREF(__pyx_r);
18503  __Pyx_RefNannyFinishContext();
18504  return __pyx_r;
18505 }
18506 
18507 /* "View.MemoryView":1109
18508  *
18509  *
18510  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18511  * if arg < 0:
18512  * return -arg
18513  */
18514 
18515 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18516  Py_ssize_t __pyx_r;
18517  int __pyx_t_1;
18518 
18519  /* "View.MemoryView":1110
18520  *
18521  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18522  * if arg < 0: # <<<<<<<<<<<<<<
18523  * return -arg
18524  * else:
18525  */
18526  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18527  if (__pyx_t_1) {
18528 
18529  /* "View.MemoryView":1111
18530  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18531  * if arg < 0:
18532  * return -arg # <<<<<<<<<<<<<<
18533  * else:
18534  * return arg
18535  */
18536  __pyx_r = (-__pyx_v_arg);
18537  goto __pyx_L0;
18538 
18539  /* "View.MemoryView":1110
18540  *
18541  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18542  * if arg < 0: # <<<<<<<<<<<<<<
18543  * return -arg
18544  * else:
18545  */
18546  }
18547 
18548  /* "View.MemoryView":1113
18549  * return -arg
18550  * else:
18551  * return arg # <<<<<<<<<<<<<<
18552  *
18553  * @cname('__pyx_get_best_slice_order')
18554  */
18555  /*else*/ {
18556  __pyx_r = __pyx_v_arg;
18557  goto __pyx_L0;
18558  }
18559 
18560  /* "View.MemoryView":1109
18561  *
18562  *
18563  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18564  * if arg < 0:
18565  * return -arg
18566  */
18567 
18568  /* function exit code */
18569  __pyx_L0:;
18570  return __pyx_r;
18571 }
18572 
18573 /* "View.MemoryView":1116
18574  *
18575  * @cname('__pyx_get_best_slice_order')
18576  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18577  * """
18578  * Figure out the best memory access order for a given slice.
18579  */
18580 
18581 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
18582  int __pyx_v_i;
18583  Py_ssize_t __pyx_v_c_stride;
18584  Py_ssize_t __pyx_v_f_stride;
18585  char __pyx_r;
18586  int __pyx_t_1;
18587  int __pyx_t_2;
18588  int __pyx_t_3;
18589  int __pyx_t_4;
18590 
18591  /* "View.MemoryView":1121
18592  * """
18593  * cdef int i
18594  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
18595  * cdef Py_ssize_t f_stride = 0
18596  *
18597  */
18598  __pyx_v_c_stride = 0;
18599 
18600  /* "View.MemoryView":1122
18601  * cdef int i
18602  * cdef Py_ssize_t c_stride = 0
18603  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
18604  *
18605  * for i in range(ndim - 1, -1, -1):
18606  */
18607  __pyx_v_f_stride = 0;
18608 
18609  /* "View.MemoryView":1124
18610  * cdef Py_ssize_t f_stride = 0
18611  *
18612  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18613  * if mslice.shape[i] > 1:
18614  * c_stride = mslice.strides[i]
18615  */
18616  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18617  __pyx_v_i = __pyx_t_1;
18618 
18619  /* "View.MemoryView":1125
18620  *
18621  * for i in range(ndim - 1, -1, -1):
18622  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18623  * c_stride = mslice.strides[i]
18624  * break
18625  */
18626  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18627  if (__pyx_t_2) {
18628 
18629  /* "View.MemoryView":1126
18630  * for i in range(ndim - 1, -1, -1):
18631  * if mslice.shape[i] > 1:
18632  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18633  * break
18634  *
18635  */
18636  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18637 
18638  /* "View.MemoryView":1127
18639  * if mslice.shape[i] > 1:
18640  * c_stride = mslice.strides[i]
18641  * break # <<<<<<<<<<<<<<
18642  *
18643  * for i in range(ndim):
18644  */
18645  goto __pyx_L4_break;
18646 
18647  /* "View.MemoryView":1125
18648  *
18649  * for i in range(ndim - 1, -1, -1):
18650  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18651  * c_stride = mslice.strides[i]
18652  * break
18653  */
18654  }
18655  }
18656  __pyx_L4_break:;
18657 
18658  /* "View.MemoryView":1129
18659  * break
18660  *
18661  * for i in range(ndim): # <<<<<<<<<<<<<<
18662  * if mslice.shape[i] > 1:
18663  * f_stride = mslice.strides[i]
18664  */
18665  __pyx_t_1 = __pyx_v_ndim;
18666  __pyx_t_3 = __pyx_t_1;
18667  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18668  __pyx_v_i = __pyx_t_4;
18669 
18670  /* "View.MemoryView":1130
18671  *
18672  * for i in range(ndim):
18673  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18674  * f_stride = mslice.strides[i]
18675  * break
18676  */
18677  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18678  if (__pyx_t_2) {
18679 
18680  /* "View.MemoryView":1131
18681  * for i in range(ndim):
18682  * if mslice.shape[i] > 1:
18683  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18684  * break
18685  *
18686  */
18687  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18688 
18689  /* "View.MemoryView":1132
18690  * if mslice.shape[i] > 1:
18691  * f_stride = mslice.strides[i]
18692  * break # <<<<<<<<<<<<<<
18693  *
18694  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18695  */
18696  goto __pyx_L7_break;
18697 
18698  /* "View.MemoryView":1130
18699  *
18700  * for i in range(ndim):
18701  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18702  * f_stride = mslice.strides[i]
18703  * break
18704  */
18705  }
18706  }
18707  __pyx_L7_break:;
18708 
18709  /* "View.MemoryView":1134
18710  * break
18711  *
18712  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18713  * return 'C'
18714  * else:
18715  */
18716  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18717  if (__pyx_t_2) {
18718 
18719  /* "View.MemoryView":1135
18720  *
18721  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18722  * return 'C' # <<<<<<<<<<<<<<
18723  * else:
18724  * return 'F'
18725  */
18726  __pyx_r = 'C';
18727  goto __pyx_L0;
18728 
18729  /* "View.MemoryView":1134
18730  * break
18731  *
18732  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18733  * return 'C'
18734  * else:
18735  */
18736  }
18737 
18738  /* "View.MemoryView":1137
18739  * return 'C'
18740  * else:
18741  * return 'F' # <<<<<<<<<<<<<<
18742  *
18743  * @cython.cdivision(True)
18744  */
18745  /*else*/ {
18746  __pyx_r = 'F';
18747  goto __pyx_L0;
18748  }
18749 
18750  /* "View.MemoryView":1116
18751  *
18752  * @cname('__pyx_get_best_slice_order')
18753  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18754  * """
18755  * Figure out the best memory access order for a given slice.
18756  */
18757 
18758  /* function exit code */
18759  __pyx_L0:;
18760  return __pyx_r;
18761 }
18762 
18763 /* "View.MemoryView":1140
18764  *
18765  * @cython.cdivision(True)
18766  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18767  * char *dst_data, Py_ssize_t *dst_strides,
18768  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18769  */
18770 
18771 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18772  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18773  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18774  Py_ssize_t __pyx_v_dst_extent;
18775  Py_ssize_t __pyx_v_src_stride;
18776  Py_ssize_t __pyx_v_dst_stride;
18777  int __pyx_t_1;
18778  int __pyx_t_2;
18779  int __pyx_t_3;
18780  Py_ssize_t __pyx_t_4;
18781  Py_ssize_t __pyx_t_5;
18782  Py_ssize_t __pyx_t_6;
18783 
18784  /* "View.MemoryView":1147
18785  *
18786  * cdef Py_ssize_t i
18787  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
18788  * cdef Py_ssize_t dst_extent = dst_shape[0]
18789  * cdef Py_ssize_t src_stride = src_strides[0]
18790  */
18791  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18792 
18793  /* "View.MemoryView":1148
18794  * cdef Py_ssize_t i
18795  * cdef Py_ssize_t src_extent = src_shape[0]
18796  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
18797  * cdef Py_ssize_t src_stride = src_strides[0]
18798  * cdef Py_ssize_t dst_stride = dst_strides[0]
18799  */
18800  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18801 
18802  /* "View.MemoryView":1149
18803  * cdef Py_ssize_t src_extent = src_shape[0]
18804  * cdef Py_ssize_t dst_extent = dst_shape[0]
18805  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
18806  * cdef Py_ssize_t dst_stride = dst_strides[0]
18807  *
18808  */
18809  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18810 
18811  /* "View.MemoryView":1150
18812  * cdef Py_ssize_t dst_extent = dst_shape[0]
18813  * cdef Py_ssize_t src_stride = src_strides[0]
18814  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
18815  *
18816  * if ndim == 1:
18817  */
18818  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18819 
18820  /* "View.MemoryView":1152
18821  * cdef Py_ssize_t dst_stride = dst_strides[0]
18822  *
18823  * if ndim == 1: # <<<<<<<<<<<<<<
18824  * if (src_stride > 0 and dst_stride > 0 and
18825  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18826  */
18827  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18828  if (__pyx_t_1) {
18829 
18830  /* "View.MemoryView":1153
18831  *
18832  * if ndim == 1:
18833  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18834  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18835  * memcpy(dst_data, src_data, itemsize * dst_extent)
18836  */
18837  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18838  if (__pyx_t_2) {
18839  } else {
18840  __pyx_t_1 = __pyx_t_2;
18841  goto __pyx_L5_bool_binop_done;
18842  }
18843  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18844  if (__pyx_t_2) {
18845  } else {
18846  __pyx_t_1 = __pyx_t_2;
18847  goto __pyx_L5_bool_binop_done;
18848  }
18849 
18850  /* "View.MemoryView":1154
18851  * if ndim == 1:
18852  * if (src_stride > 0 and dst_stride > 0 and
18853  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
18854  * memcpy(dst_data, src_data, itemsize * dst_extent)
18855  * else:
18856  */
18857  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18858  if (__pyx_t_2) {
18859  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18860  }
18861  __pyx_t_3 = (__pyx_t_2 != 0);
18862  __pyx_t_1 = __pyx_t_3;
18863  __pyx_L5_bool_binop_done:;
18864 
18865  /* "View.MemoryView":1153
18866  *
18867  * if ndim == 1:
18868  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18869  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18870  * memcpy(dst_data, src_data, itemsize * dst_extent)
18871  */
18872  if (__pyx_t_1) {
18873 
18874  /* "View.MemoryView":1155
18875  * if (src_stride > 0 and dst_stride > 0 and
18876  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18877  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
18878  * else:
18879  * for i in range(dst_extent):
18880  */
18881  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18882 
18883  /* "View.MemoryView":1153
18884  *
18885  * if ndim == 1:
18886  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18887  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18888  * memcpy(dst_data, src_data, itemsize * dst_extent)
18889  */
18890  goto __pyx_L4;
18891  }
18892 
18893  /* "View.MemoryView":1157
18894  * memcpy(dst_data, src_data, itemsize * dst_extent)
18895  * else:
18896  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18897  * memcpy(dst_data, src_data, itemsize)
18898  * src_data += src_stride
18899  */
18900  /*else*/ {
18901  __pyx_t_4 = __pyx_v_dst_extent;
18902  __pyx_t_5 = __pyx_t_4;
18903  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18904  __pyx_v_i = __pyx_t_6;
18905 
18906  /* "View.MemoryView":1158
18907  * else:
18908  * for i in range(dst_extent):
18909  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
18910  * src_data += src_stride
18911  * dst_data += dst_stride
18912  */
18913  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18914 
18915  /* "View.MemoryView":1159
18916  * for i in range(dst_extent):
18917  * memcpy(dst_data, src_data, itemsize)
18918  * src_data += src_stride # <<<<<<<<<<<<<<
18919  * dst_data += dst_stride
18920  * else:
18921  */
18922  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18923 
18924  /* "View.MemoryView":1160
18925  * memcpy(dst_data, src_data, itemsize)
18926  * src_data += src_stride
18927  * dst_data += dst_stride # <<<<<<<<<<<<<<
18928  * else:
18929  * for i in range(dst_extent):
18930  */
18931  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18932  }
18933  }
18934  __pyx_L4:;
18935 
18936  /* "View.MemoryView":1152
18937  * cdef Py_ssize_t dst_stride = dst_strides[0]
18938  *
18939  * if ndim == 1: # <<<<<<<<<<<<<<
18940  * if (src_stride > 0 and dst_stride > 0 and
18941  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18942  */
18943  goto __pyx_L3;
18944  }
18945 
18946  /* "View.MemoryView":1162
18947  * dst_data += dst_stride
18948  * else:
18949  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18950  * _copy_strided_to_strided(src_data, src_strides + 1,
18951  * dst_data, dst_strides + 1,
18952  */
18953  /*else*/ {
18954  __pyx_t_4 = __pyx_v_dst_extent;
18955  __pyx_t_5 = __pyx_t_4;
18956  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18957  __pyx_v_i = __pyx_t_6;
18958 
18959  /* "View.MemoryView":1163
18960  * else:
18961  * for i in range(dst_extent):
18962  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
18963  * dst_data, dst_strides + 1,
18964  * src_shape + 1, dst_shape + 1,
18965  */
18966  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
18967 
18968  /* "View.MemoryView":1167
18969  * src_shape + 1, dst_shape + 1,
18970  * ndim - 1, itemsize)
18971  * src_data += src_stride # <<<<<<<<<<<<<<
18972  * dst_data += dst_stride
18973  *
18974  */
18975  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18976 
18977  /* "View.MemoryView":1168
18978  * ndim - 1, itemsize)
18979  * src_data += src_stride
18980  * dst_data += dst_stride # <<<<<<<<<<<<<<
18981  *
18982  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
18983  */
18984  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18985  }
18986  }
18987  __pyx_L3:;
18988 
18989  /* "View.MemoryView":1140
18990  *
18991  * @cython.cdivision(True)
18992  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18993  * char *dst_data, Py_ssize_t *dst_strides,
18994  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18995  */
18996 
18997  /* function exit code */
18998 }
18999 
19000 /* "View.MemoryView":1170
19001  * dst_data += dst_stride
19002  *
19003  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19004  * __Pyx_memviewslice *dst,
19005  * int ndim, size_t itemsize) nogil:
19006  */
19007 
19008 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
19009 
19010  /* "View.MemoryView":1173
19011  * __Pyx_memviewslice *dst,
19012  * int ndim, size_t itemsize) nogil:
19013  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
19014  * src.shape, dst.shape, ndim, itemsize)
19015  *
19016  */
19017  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
19018 
19019  /* "View.MemoryView":1170
19020  * dst_data += dst_stride
19021  *
19022  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19023  * __Pyx_memviewslice *dst,
19024  * int ndim, size_t itemsize) nogil:
19025  */
19026 
19027  /* function exit code */
19028 }
19029 
19030 /* "View.MemoryView":1177
19031  *
19032  * @cname('__pyx_memoryview_slice_get_size')
19033  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19034  * "Return the size of the memory occupied by the slice in number of bytes"
19035  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19036  */
19037 
19038 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
19039  Py_ssize_t __pyx_v_shape;
19040  Py_ssize_t __pyx_v_size;
19041  Py_ssize_t __pyx_r;
19042  Py_ssize_t __pyx_t_1;
19043  Py_ssize_t *__pyx_t_2;
19044  Py_ssize_t *__pyx_t_3;
19045  Py_ssize_t *__pyx_t_4;
19046 
19047  /* "View.MemoryView":1179
19048  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
19049  * "Return the size of the memory occupied by the slice in number of bytes"
19050  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
19051  *
19052  * for shape in src.shape[:ndim]:
19053  */
19054  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19055  __pyx_v_size = __pyx_t_1;
19056 
19057  /* "View.MemoryView":1181
19058  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19059  *
19060  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
19061  * size *= shape
19062  *
19063  */
19064  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
19065  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
19066  __pyx_t_2 = __pyx_t_4;
19067  __pyx_v_shape = (__pyx_t_2[0]);
19068 
19069  /* "View.MemoryView":1182
19070  *
19071  * for shape in src.shape[:ndim]:
19072  * size *= shape # <<<<<<<<<<<<<<
19073  *
19074  * return size
19075  */
19076  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
19077  }
19078 
19079  /* "View.MemoryView":1184
19080  * size *= shape
19081  *
19082  * return size # <<<<<<<<<<<<<<
19083  *
19084  * @cname('__pyx_fill_contig_strides_array')
19085  */
19086  __pyx_r = __pyx_v_size;
19087  goto __pyx_L0;
19088 
19089  /* "View.MemoryView":1177
19090  *
19091  * @cname('__pyx_memoryview_slice_get_size')
19092  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19093  * "Return the size of the memory occupied by the slice in number of bytes"
19094  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19095  */
19096 
19097  /* function exit code */
19098  __pyx_L0:;
19099  return __pyx_r;
19100 }
19101 
19102 /* "View.MemoryView":1187
19103  *
19104  * @cname('__pyx_fill_contig_strides_array')
19105  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19106  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19107  * int ndim, char order) nogil:
19108  */
19109 
19110 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
19111  int __pyx_v_idx;
19112  Py_ssize_t __pyx_r;
19113  int __pyx_t_1;
19114  int __pyx_t_2;
19115  int __pyx_t_3;
19116  int __pyx_t_4;
19117 
19118  /* "View.MemoryView":1196
19119  * cdef int idx
19120  *
19121  * if order == 'F': # <<<<<<<<<<<<<<
19122  * for idx in range(ndim):
19123  * strides[idx] = stride
19124  */
19125  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
19126  if (__pyx_t_1) {
19127 
19128  /* "View.MemoryView":1197
19129  *
19130  * if order == 'F':
19131  * for idx in range(ndim): # <<<<<<<<<<<<<<
19132  * strides[idx] = stride
19133  * stride *= shape[idx]
19134  */
19135  __pyx_t_2 = __pyx_v_ndim;
19136  __pyx_t_3 = __pyx_t_2;
19137  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19138  __pyx_v_idx = __pyx_t_4;
19139 
19140  /* "View.MemoryView":1198
19141  * if order == 'F':
19142  * for idx in range(ndim):
19143  * strides[idx] = stride # <<<<<<<<<<<<<<
19144  * stride *= shape[idx]
19145  * else:
19146  */
19147  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19148 
19149  /* "View.MemoryView":1199
19150  * for idx in range(ndim):
19151  * strides[idx] = stride
19152  * stride *= shape[idx] # <<<<<<<<<<<<<<
19153  * else:
19154  * for idx in range(ndim - 1, -1, -1):
19155  */
19156  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19157  }
19158 
19159  /* "View.MemoryView":1196
19160  * cdef int idx
19161  *
19162  * if order == 'F': # <<<<<<<<<<<<<<
19163  * for idx in range(ndim):
19164  * strides[idx] = stride
19165  */
19166  goto __pyx_L3;
19167  }
19168 
19169  /* "View.MemoryView":1201
19170  * stride *= shape[idx]
19171  * else:
19172  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19173  * strides[idx] = stride
19174  * stride *= shape[idx]
19175  */
19176  /*else*/ {
19177  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19178  __pyx_v_idx = __pyx_t_2;
19179 
19180  /* "View.MemoryView":1202
19181  * else:
19182  * for idx in range(ndim - 1, -1, -1):
19183  * strides[idx] = stride # <<<<<<<<<<<<<<
19184  * stride *= shape[idx]
19185  *
19186  */
19187  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19188 
19189  /* "View.MemoryView":1203
19190  * for idx in range(ndim - 1, -1, -1):
19191  * strides[idx] = stride
19192  * stride *= shape[idx] # <<<<<<<<<<<<<<
19193  *
19194  * return stride
19195  */
19196  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19197  }
19198  }
19199  __pyx_L3:;
19200 
19201  /* "View.MemoryView":1205
19202  * stride *= shape[idx]
19203  *
19204  * return stride # <<<<<<<<<<<<<<
19205  *
19206  * @cname('__pyx_memoryview_copy_data_to_temp')
19207  */
19208  __pyx_r = __pyx_v_stride;
19209  goto __pyx_L0;
19210 
19211  /* "View.MemoryView":1187
19212  *
19213  * @cname('__pyx_fill_contig_strides_array')
19214  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19215  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19216  * int ndim, char order) nogil:
19217  */
19218 
19219  /* function exit code */
19220  __pyx_L0:;
19221  return __pyx_r;
19222 }
19223 
19224 /* "View.MemoryView":1208
19225  *
19226  * @cname('__pyx_memoryview_copy_data_to_temp')
19227  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19228  * __Pyx_memviewslice *tmpslice,
19229  * char order,
19230  */
19231 
19232 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
19233  int __pyx_v_i;
19234  void *__pyx_v_result;
19235  size_t __pyx_v_itemsize;
19236  size_t __pyx_v_size;
19237  void *__pyx_r;
19238  Py_ssize_t __pyx_t_1;
19239  int __pyx_t_2;
19240  int __pyx_t_3;
19241  struct __pyx_memoryview_obj *__pyx_t_4;
19242  int __pyx_t_5;
19243  int __pyx_t_6;
19244 
19245  /* "View.MemoryView":1219
19246  * cdef void *result
19247  *
19248  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19249  * cdef size_t size = slice_get_size(src, ndim)
19250  *
19251  */
19252  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19253  __pyx_v_itemsize = __pyx_t_1;
19254 
19255  /* "View.MemoryView":1220
19256  *
19257  * cdef size_t itemsize = src.memview.view.itemsize
19258  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
19259  *
19260  * result = malloc(size)
19261  */
19262  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19263 
19264  /* "View.MemoryView":1222
19265  * cdef size_t size = slice_get_size(src, ndim)
19266  *
19267  * result = malloc(size) # <<<<<<<<<<<<<<
19268  * if not result:
19269  * _err(MemoryError, NULL)
19270  */
19271  __pyx_v_result = malloc(__pyx_v_size);
19272 
19273  /* "View.MemoryView":1223
19274  *
19275  * result = malloc(size)
19276  * if not result: # <<<<<<<<<<<<<<
19277  * _err(MemoryError, NULL)
19278  *
19279  */
19280  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19281  if (__pyx_t_2) {
19282 
19283  /* "View.MemoryView":1224
19284  * result = malloc(size)
19285  * if not result:
19286  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
19287  *
19288  *
19289  */
19290  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
19291 
19292  /* "View.MemoryView":1223
19293  *
19294  * result = malloc(size)
19295  * if not result: # <<<<<<<<<<<<<<
19296  * _err(MemoryError, NULL)
19297  *
19298  */
19299  }
19300 
19301  /* "View.MemoryView":1227
19302  *
19303  *
19304  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
19305  * tmpslice.memview = src.memview
19306  * for i in range(ndim):
19307  */
19308  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
19309 
19310  /* "View.MemoryView":1228
19311  *
19312  * tmpslice.data = <char *> result
19313  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
19314  * for i in range(ndim):
19315  * tmpslice.shape[i] = src.shape[i]
19316  */
19317  __pyx_t_4 = __pyx_v_src->memview;
19318  __pyx_v_tmpslice->memview = __pyx_t_4;
19319 
19320  /* "View.MemoryView":1229
19321  * tmpslice.data = <char *> result
19322  * tmpslice.memview = src.memview
19323  * for i in range(ndim): # <<<<<<<<<<<<<<
19324  * tmpslice.shape[i] = src.shape[i]
19325  * tmpslice.suboffsets[i] = -1
19326  */
19327  __pyx_t_3 = __pyx_v_ndim;
19328  __pyx_t_5 = __pyx_t_3;
19329  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19330  __pyx_v_i = __pyx_t_6;
19331 
19332  /* "View.MemoryView":1230
19333  * tmpslice.memview = src.memview
19334  * for i in range(ndim):
19335  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
19336  * tmpslice.suboffsets[i] = -1
19337  *
19338  */
19339  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19340 
19341  /* "View.MemoryView":1231
19342  * for i in range(ndim):
19343  * tmpslice.shape[i] = src.shape[i]
19344  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19345  *
19346  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
19347  */
19348  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
19349  }
19350 
19351  /* "View.MemoryView":1233
19352  * tmpslice.suboffsets[i] = -1
19353  *
19354  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
19355  * ndim, order)
19356  *
19357  */
19358  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
19359 
19360  /* "View.MemoryView":1237
19361  *
19362  *
19363  * for i in range(ndim): # <<<<<<<<<<<<<<
19364  * if tmpslice.shape[i] == 1:
19365  * tmpslice.strides[i] = 0
19366  */
19367  __pyx_t_3 = __pyx_v_ndim;
19368  __pyx_t_5 = __pyx_t_3;
19369  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19370  __pyx_v_i = __pyx_t_6;
19371 
19372  /* "View.MemoryView":1238
19373  *
19374  * for i in range(ndim):
19375  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19376  * tmpslice.strides[i] = 0
19377  *
19378  */
19379  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19380  if (__pyx_t_2) {
19381 
19382  /* "View.MemoryView":1239
19383  * for i in range(ndim):
19384  * if tmpslice.shape[i] == 1:
19385  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
19386  *
19387  * if slice_is_contig(src[0], order, ndim):
19388  */
19389  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19390 
19391  /* "View.MemoryView":1238
19392  *
19393  * for i in range(ndim):
19394  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19395  * tmpslice.strides[i] = 0
19396  *
19397  */
19398  }
19399  }
19400 
19401  /* "View.MemoryView":1241
19402  * tmpslice.strides[i] = 0
19403  *
19404  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19405  * memcpy(result, src.data, size)
19406  * else:
19407  */
19408  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19409  if (__pyx_t_2) {
19410 
19411  /* "View.MemoryView":1242
19412  *
19413  * if slice_is_contig(src[0], order, ndim):
19414  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
19415  * else:
19416  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19417  */
19418  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19419 
19420  /* "View.MemoryView":1241
19421  * tmpslice.strides[i] = 0
19422  *
19423  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19424  * memcpy(result, src.data, size)
19425  * else:
19426  */
19427  goto __pyx_L9;
19428  }
19429 
19430  /* "View.MemoryView":1244
19431  * memcpy(result, src.data, size)
19432  * else:
19433  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
19434  *
19435  * return result
19436  */
19437  /*else*/ {
19438  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19439  }
19440  __pyx_L9:;
19441 
19442  /* "View.MemoryView":1246
19443  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19444  *
19445  * return result # <<<<<<<<<<<<<<
19446  *
19447  *
19448  */
19449  __pyx_r = __pyx_v_result;
19450  goto __pyx_L0;
19451 
19452  /* "View.MemoryView":1208
19453  *
19454  * @cname('__pyx_memoryview_copy_data_to_temp')
19455  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19456  * __Pyx_memviewslice *tmpslice,
19457  * char order,
19458  */
19459 
19460  /* function exit code */
19461  __pyx_L1_error:;
19462  {
19463  #ifdef WITH_THREAD
19464  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19465  #endif
19466  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19467  #ifdef WITH_THREAD
19468  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19469  #endif
19470  }
19471  __pyx_r = NULL;
19472  __pyx_L0:;
19473  return __pyx_r;
19474 }
19475 
19476 /* "View.MemoryView":1251
19477  *
19478  * @cname('__pyx_memoryview_err_extents')
19479  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19480  * Py_ssize_t extent2) except -1 with gil:
19481  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19482  */
19483 
19484 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19485  int __pyx_r;
19486  __Pyx_RefNannyDeclarations
19487  PyObject *__pyx_t_1 = NULL;
19488  PyObject *__pyx_t_2 = NULL;
19489  PyObject *__pyx_t_3 = NULL;
19490  PyObject *__pyx_t_4 = NULL;
19491  #ifdef WITH_THREAD
19492  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19493  #endif
19494  __Pyx_RefNannySetupContext("_err_extents", 0);
19495 
19496  /* "View.MemoryView":1254
19497  * Py_ssize_t extent2) except -1 with gil:
19498  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19499  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
19500  *
19501  * @cname('__pyx_memoryview_err_dim')
19502  */
19503  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19504  __Pyx_GOTREF(__pyx_t_1);
19505  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
19506  __Pyx_GOTREF(__pyx_t_2);
19507  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
19508  __Pyx_GOTREF(__pyx_t_3);
19509  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
19510  __Pyx_GOTREF(__pyx_t_4);
19511  __Pyx_GIVEREF(__pyx_t_1);
19512  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19513  __Pyx_GIVEREF(__pyx_t_2);
19514  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19515  __Pyx_GIVEREF(__pyx_t_3);
19516  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19517  __pyx_t_1 = 0;
19518  __pyx_t_2 = 0;
19519  __pyx_t_3 = 0;
19520 
19521  /* "View.MemoryView":1253
19522  * cdef int _err_extents(int i, Py_ssize_t extent1,
19523  * Py_ssize_t extent2) except -1 with gil:
19524  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
19525  * (i, extent1, extent2))
19526  *
19527  */
19528  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
19529  __Pyx_GOTREF(__pyx_t_3);
19530  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19531  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
19532  __Pyx_GOTREF(__pyx_t_4);
19533  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19534  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19535  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19536  __PYX_ERR(1, 1253, __pyx_L1_error)
19537 
19538  /* "View.MemoryView":1251
19539  *
19540  * @cname('__pyx_memoryview_err_extents')
19541  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19542  * Py_ssize_t extent2) except -1 with gil:
19543  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19544  */
19545 
19546  /* function exit code */
19547  __pyx_L1_error:;
19548  __Pyx_XDECREF(__pyx_t_1);
19549  __Pyx_XDECREF(__pyx_t_2);
19550  __Pyx_XDECREF(__pyx_t_3);
19551  __Pyx_XDECREF(__pyx_t_4);
19552  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19553  __pyx_r = -1;
19554  __Pyx_RefNannyFinishContext();
19555  #ifdef WITH_THREAD
19556  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19557  #endif
19558  return __pyx_r;
19559 }
19560 
19561 /* "View.MemoryView":1257
19562  *
19563  * @cname('__pyx_memoryview_err_dim')
19564  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19565  * raise error(msg.decode('ascii') % dim)
19566  *
19567  */
19568 
19569 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
19570  int __pyx_r;
19571  __Pyx_RefNannyDeclarations
19572  PyObject *__pyx_t_1 = NULL;
19573  PyObject *__pyx_t_2 = NULL;
19574  PyObject *__pyx_t_3 = NULL;
19575  PyObject *__pyx_t_4 = NULL;
19576  #ifdef WITH_THREAD
19577  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19578  #endif
19579  __Pyx_RefNannySetupContext("_err_dim", 0);
19580  __Pyx_INCREF(__pyx_v_error);
19581 
19582  /* "View.MemoryView":1258
19583  * @cname('__pyx_memoryview_err_dim')
19584  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
19585  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
19586  *
19587  * @cname('__pyx_memoryview_err')
19588  */
19589  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
19590  __Pyx_GOTREF(__pyx_t_2);
19591  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
19592  __Pyx_GOTREF(__pyx_t_3);
19593  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
19594  __Pyx_GOTREF(__pyx_t_4);
19595  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19596  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19597  __Pyx_INCREF(__pyx_v_error);
19598  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19599  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19600  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19601  if (likely(__pyx_t_2)) {
19602  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19603  __Pyx_INCREF(__pyx_t_2);
19604  __Pyx_INCREF(function);
19605  __Pyx_DECREF_SET(__pyx_t_3, function);
19606  }
19607  }
19608  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
19609  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19610  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19611  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
19612  __Pyx_GOTREF(__pyx_t_1);
19613  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19614  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19615  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19616  __PYX_ERR(1, 1258, __pyx_L1_error)
19617 
19618  /* "View.MemoryView":1257
19619  *
19620  * @cname('__pyx_memoryview_err_dim')
19621  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19622  * raise error(msg.decode('ascii') % dim)
19623  *
19624  */
19625 
19626  /* function exit code */
19627  __pyx_L1_error:;
19628  __Pyx_XDECREF(__pyx_t_1);
19629  __Pyx_XDECREF(__pyx_t_2);
19630  __Pyx_XDECREF(__pyx_t_3);
19631  __Pyx_XDECREF(__pyx_t_4);
19632  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19633  __pyx_r = -1;
19634  __Pyx_XDECREF(__pyx_v_error);
19635  __Pyx_RefNannyFinishContext();
19636  #ifdef WITH_THREAD
19637  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19638  #endif
19639  return __pyx_r;
19640 }
19641 
19642 /* "View.MemoryView":1261
19643  *
19644  * @cname('__pyx_memoryview_err')
19645  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19646  * if msg != NULL:
19647  * raise error(msg.decode('ascii'))
19648  */
19649 
19650 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
19651  int __pyx_r;
19652  __Pyx_RefNannyDeclarations
19653  int __pyx_t_1;
19654  PyObject *__pyx_t_2 = NULL;
19655  PyObject *__pyx_t_3 = NULL;
19656  PyObject *__pyx_t_4 = NULL;
19657  PyObject *__pyx_t_5 = NULL;
19658  #ifdef WITH_THREAD
19659  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19660  #endif
19661  __Pyx_RefNannySetupContext("_err", 0);
19662  __Pyx_INCREF(__pyx_v_error);
19663 
19664  /* "View.MemoryView":1262
19665  * @cname('__pyx_memoryview_err')
19666  * cdef int _err(object error, char *msg) except -1 with gil:
19667  * if msg != NULL: # <<<<<<<<<<<<<<
19668  * raise error(msg.decode('ascii'))
19669  * else:
19670  */
19671  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19672  if (unlikely(__pyx_t_1)) {
19673 
19674  /* "View.MemoryView":1263
19675  * cdef int _err(object error, char *msg) except -1 with gil:
19676  * if msg != NULL:
19677  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
19678  * else:
19679  * raise error
19680  */
19681  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
19682  __Pyx_GOTREF(__pyx_t_3);
19683  __Pyx_INCREF(__pyx_v_error);
19684  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19685  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19686  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19687  if (likely(__pyx_t_5)) {
19688  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
19689  __Pyx_INCREF(__pyx_t_5);
19690  __Pyx_INCREF(function);
19691  __Pyx_DECREF_SET(__pyx_t_4, function);
19692  }
19693  }
19694  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
19695  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19696  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19697  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
19698  __Pyx_GOTREF(__pyx_t_2);
19699  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19700  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19701  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19702  __PYX_ERR(1, 1263, __pyx_L1_error)
19703 
19704  /* "View.MemoryView":1262
19705  * @cname('__pyx_memoryview_err')
19706  * cdef int _err(object error, char *msg) except -1 with gil:
19707  * if msg != NULL: # <<<<<<<<<<<<<<
19708  * raise error(msg.decode('ascii'))
19709  * else:
19710  */
19711  }
19712 
19713  /* "View.MemoryView":1265
19714  * raise error(msg.decode('ascii'))
19715  * else:
19716  * raise error # <<<<<<<<<<<<<<
19717  *
19718  * @cname('__pyx_memoryview_copy_contents')
19719  */
19720  /*else*/ {
19721  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19722  __PYX_ERR(1, 1265, __pyx_L1_error)
19723  }
19724 
19725  /* "View.MemoryView":1261
19726  *
19727  * @cname('__pyx_memoryview_err')
19728  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19729  * if msg != NULL:
19730  * raise error(msg.decode('ascii'))
19731  */
19732 
19733  /* function exit code */
19734  __pyx_L1_error:;
19735  __Pyx_XDECREF(__pyx_t_2);
19736  __Pyx_XDECREF(__pyx_t_3);
19737  __Pyx_XDECREF(__pyx_t_4);
19738  __Pyx_XDECREF(__pyx_t_5);
19739  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19740  __pyx_r = -1;
19741  __Pyx_XDECREF(__pyx_v_error);
19742  __Pyx_RefNannyFinishContext();
19743  #ifdef WITH_THREAD
19744  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19745  #endif
19746  return __pyx_r;
19747 }
19748 
19749 /* "View.MemoryView":1268
19750  *
19751  * @cname('__pyx_memoryview_copy_contents')
19752  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19753  * __Pyx_memviewslice dst,
19754  * int src_ndim, int dst_ndim,
19755  */
19756 
19757 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
19758  void *__pyx_v_tmpdata;
19759  size_t __pyx_v_itemsize;
19760  int __pyx_v_i;
19761  char __pyx_v_order;
19762  int __pyx_v_broadcasting;
19763  int __pyx_v_direct_copy;
19764  __Pyx_memviewslice __pyx_v_tmp;
19765  int __pyx_v_ndim;
19766  int __pyx_r;
19767  Py_ssize_t __pyx_t_1;
19768  int __pyx_t_2;
19769  int __pyx_t_3;
19770  int __pyx_t_4;
19771  int __pyx_t_5;
19772  int __pyx_t_6;
19773  void *__pyx_t_7;
19774  int __pyx_t_8;
19775 
19776  /* "View.MemoryView":1276
19777  * Check for overlapping memory and verify the shapes.
19778  * """
19779  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
19780  * cdef size_t itemsize = src.memview.view.itemsize
19781  * cdef int i
19782  */
19783  __pyx_v_tmpdata = NULL;
19784 
19785  /* "View.MemoryView":1277
19786  * """
19787  * cdef void *tmpdata = NULL
19788  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19789  * cdef int i
19790  * cdef char order = get_best_order(&src, src_ndim)
19791  */
19792  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19793  __pyx_v_itemsize = __pyx_t_1;
19794 
19795  /* "View.MemoryView":1279
19796  * cdef size_t itemsize = src.memview.view.itemsize
19797  * cdef int i
19798  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
19799  * cdef bint broadcasting = False
19800  * cdef bint direct_copy = False
19801  */
19802  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19803 
19804  /* "View.MemoryView":1280
19805  * cdef int i
19806  * cdef char order = get_best_order(&src, src_ndim)
19807  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
19808  * cdef bint direct_copy = False
19809  * cdef __Pyx_memviewslice tmp
19810  */
19811  __pyx_v_broadcasting = 0;
19812 
19813  /* "View.MemoryView":1281
19814  * cdef char order = get_best_order(&src, src_ndim)
19815  * cdef bint broadcasting = False
19816  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
19817  * cdef __Pyx_memviewslice tmp
19818  *
19819  */
19820  __pyx_v_direct_copy = 0;
19821 
19822  /* "View.MemoryView":1284
19823  * cdef __Pyx_memviewslice tmp
19824  *
19825  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19826  * broadcast_leading(&src, src_ndim, dst_ndim)
19827  * elif dst_ndim < src_ndim:
19828  */
19829  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19830  if (__pyx_t_2) {
19831 
19832  /* "View.MemoryView":1285
19833  *
19834  * if src_ndim < dst_ndim:
19835  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19836  * elif dst_ndim < src_ndim:
19837  * broadcast_leading(&dst, dst_ndim, src_ndim)
19838  */
19839  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19840 
19841  /* "View.MemoryView":1284
19842  * cdef __Pyx_memviewslice tmp
19843  *
19844  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19845  * broadcast_leading(&src, src_ndim, dst_ndim)
19846  * elif dst_ndim < src_ndim:
19847  */
19848  goto __pyx_L3;
19849  }
19850 
19851  /* "View.MemoryView":1286
19852  * if src_ndim < dst_ndim:
19853  * broadcast_leading(&src, src_ndim, dst_ndim)
19854  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19855  * broadcast_leading(&dst, dst_ndim, src_ndim)
19856  *
19857  */
19858  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19859  if (__pyx_t_2) {
19860 
19861  /* "View.MemoryView":1287
19862  * broadcast_leading(&src, src_ndim, dst_ndim)
19863  * elif dst_ndim < src_ndim:
19864  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
19865  *
19866  * cdef int ndim = max(src_ndim, dst_ndim)
19867  */
19868  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19869 
19870  /* "View.MemoryView":1286
19871  * if src_ndim < dst_ndim:
19872  * broadcast_leading(&src, src_ndim, dst_ndim)
19873  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19874  * broadcast_leading(&dst, dst_ndim, src_ndim)
19875  *
19876  */
19877  }
19878  __pyx_L3:;
19879 
19880  /* "View.MemoryView":1289
19881  * broadcast_leading(&dst, dst_ndim, src_ndim)
19882  *
19883  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19884  *
19885  * for i in range(ndim):
19886  */
19887  __pyx_t_3 = __pyx_v_dst_ndim;
19888  __pyx_t_4 = __pyx_v_src_ndim;
19889  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19890  __pyx_t_5 = __pyx_t_3;
19891  } else {
19892  __pyx_t_5 = __pyx_t_4;
19893  }
19894  __pyx_v_ndim = __pyx_t_5;
19895 
19896  /* "View.MemoryView":1291
19897  * cdef int ndim = max(src_ndim, dst_ndim)
19898  *
19899  * for i in range(ndim): # <<<<<<<<<<<<<<
19900  * if src.shape[i] != dst.shape[i]:
19901  * if src.shape[i] == 1:
19902  */
19903  __pyx_t_5 = __pyx_v_ndim;
19904  __pyx_t_3 = __pyx_t_5;
19905  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19906  __pyx_v_i = __pyx_t_4;
19907 
19908  /* "View.MemoryView":1292
19909  *
19910  * for i in range(ndim):
19911  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19912  * if src.shape[i] == 1:
19913  * broadcasting = True
19914  */
19915  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19916  if (__pyx_t_2) {
19917 
19918  /* "View.MemoryView":1293
19919  * for i in range(ndim):
19920  * if src.shape[i] != dst.shape[i]:
19921  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19922  * broadcasting = True
19923  * src.strides[i] = 0
19924  */
19925  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19926  if (__pyx_t_2) {
19927 
19928  /* "View.MemoryView":1294
19929  * if src.shape[i] != dst.shape[i]:
19930  * if src.shape[i] == 1:
19931  * broadcasting = True # <<<<<<<<<<<<<<
19932  * src.strides[i] = 0
19933  * else:
19934  */
19935  __pyx_v_broadcasting = 1;
19936 
19937  /* "View.MemoryView":1295
19938  * if src.shape[i] == 1:
19939  * broadcasting = True
19940  * src.strides[i] = 0 # <<<<<<<<<<<<<<
19941  * else:
19942  * _err_extents(i, dst.shape[i], src.shape[i])
19943  */
19944  (__pyx_v_src.strides[__pyx_v_i]) = 0;
19945 
19946  /* "View.MemoryView":1293
19947  * for i in range(ndim):
19948  * if src.shape[i] != dst.shape[i]:
19949  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19950  * broadcasting = True
19951  * src.strides[i] = 0
19952  */
19953  goto __pyx_L7;
19954  }
19955 
19956  /* "View.MemoryView":1297
19957  * src.strides[i] = 0
19958  * else:
19959  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
19960  *
19961  * if src.suboffsets[i] >= 0:
19962  */
19963  /*else*/ {
19964  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
19965  }
19966  __pyx_L7:;
19967 
19968  /* "View.MemoryView":1292
19969  *
19970  * for i in range(ndim):
19971  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19972  * if src.shape[i] == 1:
19973  * broadcasting = True
19974  */
19975  }
19976 
19977  /* "View.MemoryView":1299
19978  * _err_extents(i, dst.shape[i], src.shape[i])
19979  *
19980  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19981  * _err_dim(ValueError, "Dimension %d is not direct", i)
19982  *
19983  */
19984  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19985  if (__pyx_t_2) {
19986 
19987  /* "View.MemoryView":1300
19988  *
19989  * if src.suboffsets[i] >= 0:
19990  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
19991  *
19992  * if slices_overlap(&src, &dst, ndim, itemsize):
19993  */
19994  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
19995 
19996  /* "View.MemoryView":1299
19997  * _err_extents(i, dst.shape[i], src.shape[i])
19998  *
19999  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20000  * _err_dim(ValueError, "Dimension %d is not direct", i)
20001  *
20002  */
20003  }
20004  }
20005 
20006  /* "View.MemoryView":1302
20007  * _err_dim(ValueError, "Dimension %d is not direct", i)
20008  *
20009  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20010  *
20011  * if not slice_is_contig(src, order, ndim):
20012  */
20013  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
20014  if (__pyx_t_2) {
20015 
20016  /* "View.MemoryView":1304
20017  * if slices_overlap(&src, &dst, ndim, itemsize):
20018  *
20019  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20020  * order = get_best_order(&dst, ndim)
20021  *
20022  */
20023  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
20024  if (__pyx_t_2) {
20025 
20026  /* "View.MemoryView":1305
20027  *
20028  * if not slice_is_contig(src, order, ndim):
20029  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
20030  *
20031  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20032  */
20033  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
20034 
20035  /* "View.MemoryView":1304
20036  * if slices_overlap(&src, &dst, ndim, itemsize):
20037  *
20038  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20039  * order = get_best_order(&dst, ndim)
20040  *
20041  */
20042  }
20043 
20044  /* "View.MemoryView":1307
20045  * order = get_best_order(&dst, ndim)
20046  *
20047  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
20048  * src = tmp
20049  *
20050  */
20051  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
20052  __pyx_v_tmpdata = __pyx_t_7;
20053 
20054  /* "View.MemoryView":1308
20055  *
20056  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20057  * src = tmp # <<<<<<<<<<<<<<
20058  *
20059  * if not broadcasting:
20060  */
20061  __pyx_v_src = __pyx_v_tmp;
20062 
20063  /* "View.MemoryView":1302
20064  * _err_dim(ValueError, "Dimension %d is not direct", i)
20065  *
20066  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20067  *
20068  * if not slice_is_contig(src, order, ndim):
20069  */
20070  }
20071 
20072  /* "View.MemoryView":1310
20073  * src = tmp
20074  *
20075  * if not broadcasting: # <<<<<<<<<<<<<<
20076  *
20077  *
20078  */
20079  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
20080  if (__pyx_t_2) {
20081 
20082  /* "View.MemoryView":1313
20083  *
20084  *
20085  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20086  * direct_copy = slice_is_contig(dst, 'C', ndim)
20087  * elif slice_is_contig(src, 'F', ndim):
20088  */
20089  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
20090  if (__pyx_t_2) {
20091 
20092  /* "View.MemoryView":1314
20093  *
20094  * if slice_is_contig(src, 'C', ndim):
20095  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
20096  * elif slice_is_contig(src, 'F', ndim):
20097  * direct_copy = slice_is_contig(dst, 'F', ndim)
20098  */
20099  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
20100 
20101  /* "View.MemoryView":1313
20102  *
20103  *
20104  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20105  * direct_copy = slice_is_contig(dst, 'C', ndim)
20106  * elif slice_is_contig(src, 'F', ndim):
20107  */
20108  goto __pyx_L12;
20109  }
20110 
20111  /* "View.MemoryView":1315
20112  * if slice_is_contig(src, 'C', ndim):
20113  * direct_copy = slice_is_contig(dst, 'C', ndim)
20114  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20115  * direct_copy = slice_is_contig(dst, 'F', ndim)
20116  *
20117  */
20118  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
20119  if (__pyx_t_2) {
20120 
20121  /* "View.MemoryView":1316
20122  * direct_copy = slice_is_contig(dst, 'C', ndim)
20123  * elif slice_is_contig(src, 'F', ndim):
20124  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
20125  *
20126  * if direct_copy:
20127  */
20128  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
20129 
20130  /* "View.MemoryView":1315
20131  * if slice_is_contig(src, 'C', ndim):
20132  * direct_copy = slice_is_contig(dst, 'C', ndim)
20133  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20134  * direct_copy = slice_is_contig(dst, 'F', ndim)
20135  *
20136  */
20137  }
20138  __pyx_L12:;
20139 
20140  /* "View.MemoryView":1318
20141  * direct_copy = slice_is_contig(dst, 'F', ndim)
20142  *
20143  * if direct_copy: # <<<<<<<<<<<<<<
20144  *
20145  * refcount_copying(&dst, dtype_is_object, ndim, False)
20146  */
20147  __pyx_t_2 = (__pyx_v_direct_copy != 0);
20148  if (__pyx_t_2) {
20149 
20150  /* "View.MemoryView":1320
20151  * if direct_copy:
20152  *
20153  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20154  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20155  * refcount_copying(&dst, dtype_is_object, ndim, True)
20156  */
20157  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20158 
20159  /* "View.MemoryView":1321
20160  *
20161  * refcount_copying(&dst, dtype_is_object, ndim, False)
20162  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
20163  * refcount_copying(&dst, dtype_is_object, ndim, True)
20164  * free(tmpdata)
20165  */
20166  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20167 
20168  /* "View.MemoryView":1322
20169  * refcount_copying(&dst, dtype_is_object, ndim, False)
20170  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20171  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20172  * free(tmpdata)
20173  * return 0
20174  */
20175  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20176 
20177  /* "View.MemoryView":1323
20178  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20179  * refcount_copying(&dst, dtype_is_object, ndim, True)
20180  * free(tmpdata) # <<<<<<<<<<<<<<
20181  * return 0
20182  *
20183  */
20184  free(__pyx_v_tmpdata);
20185 
20186  /* "View.MemoryView":1324
20187  * refcount_copying(&dst, dtype_is_object, ndim, True)
20188  * free(tmpdata)
20189  * return 0 # <<<<<<<<<<<<<<
20190  *
20191  * if order == 'F' == get_best_order(&dst, ndim):
20192  */
20193  __pyx_r = 0;
20194  goto __pyx_L0;
20195 
20196  /* "View.MemoryView":1318
20197  * direct_copy = slice_is_contig(dst, 'F', ndim)
20198  *
20199  * if direct_copy: # <<<<<<<<<<<<<<
20200  *
20201  * refcount_copying(&dst, dtype_is_object, ndim, False)
20202  */
20203  }
20204 
20205  /* "View.MemoryView":1310
20206  * src = tmp
20207  *
20208  * if not broadcasting: # <<<<<<<<<<<<<<
20209  *
20210  *
20211  */
20212  }
20213 
20214  /* "View.MemoryView":1326
20215  * return 0
20216  *
20217  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20218  *
20219  *
20220  */
20221  __pyx_t_2 = (__pyx_v_order == 'F');
20222  if (__pyx_t_2) {
20223  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20224  }
20225  __pyx_t_8 = (__pyx_t_2 != 0);
20226  if (__pyx_t_8) {
20227 
20228  /* "View.MemoryView":1329
20229  *
20230  *
20231  * transpose_memslice(&src) # <<<<<<<<<<<<<<
20232  * transpose_memslice(&dst)
20233  *
20234  */
20235  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
20236 
20237  /* "View.MemoryView":1330
20238  *
20239  * transpose_memslice(&src)
20240  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
20241  *
20242  * refcount_copying(&dst, dtype_is_object, ndim, False)
20243  */
20244  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
20245 
20246  /* "View.MemoryView":1326
20247  * return 0
20248  *
20249  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20250  *
20251  *
20252  */
20253  }
20254 
20255  /* "View.MemoryView":1332
20256  * transpose_memslice(&dst)
20257  *
20258  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20259  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20260  * refcount_copying(&dst, dtype_is_object, ndim, True)
20261  */
20262  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20263 
20264  /* "View.MemoryView":1333
20265  *
20266  * refcount_copying(&dst, dtype_is_object, ndim, False)
20267  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
20268  * refcount_copying(&dst, dtype_is_object, ndim, True)
20269  *
20270  */
20271  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20272 
20273  /* "View.MemoryView":1334
20274  * refcount_copying(&dst, dtype_is_object, ndim, False)
20275  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20276  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20277  *
20278  * free(tmpdata)
20279  */
20280  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20281 
20282  /* "View.MemoryView":1336
20283  * refcount_copying(&dst, dtype_is_object, ndim, True)
20284  *
20285  * free(tmpdata) # <<<<<<<<<<<<<<
20286  * return 0
20287  *
20288  */
20289  free(__pyx_v_tmpdata);
20290 
20291  /* "View.MemoryView":1337
20292  *
20293  * free(tmpdata)
20294  * return 0 # <<<<<<<<<<<<<<
20295  *
20296  * @cname('__pyx_memoryview_broadcast_leading')
20297  */
20298  __pyx_r = 0;
20299  goto __pyx_L0;
20300 
20301  /* "View.MemoryView":1268
20302  *
20303  * @cname('__pyx_memoryview_copy_contents')
20304  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20305  * __Pyx_memviewslice dst,
20306  * int src_ndim, int dst_ndim,
20307  */
20308 
20309  /* function exit code */
20310  __pyx_L1_error:;
20311  {
20312  #ifdef WITH_THREAD
20313  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20314  #endif
20315  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20316  #ifdef WITH_THREAD
20317  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20318  #endif
20319  }
20320  __pyx_r = -1;
20321  __pyx_L0:;
20322  return __pyx_r;
20323 }
20324 
20325 /* "View.MemoryView":1340
20326  *
20327  * @cname('__pyx_memoryview_broadcast_leading')
20328  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20329  * int ndim,
20330  * int ndim_other) nogil:
20331  */
20332 
20333 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
20334  int __pyx_v_i;
20335  int __pyx_v_offset;
20336  int __pyx_t_1;
20337  int __pyx_t_2;
20338  int __pyx_t_3;
20339 
20340  /* "View.MemoryView":1344
20341  * int ndim_other) nogil:
20342  * cdef int i
20343  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
20344  *
20345  * for i in range(ndim - 1, -1, -1):
20346  */
20347  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20348 
20349  /* "View.MemoryView":1346
20350  * cdef int offset = ndim_other - ndim
20351  *
20352  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
20353  * mslice.shape[i + offset] = mslice.shape[i]
20354  * mslice.strides[i + offset] = mslice.strides[i]
20355  */
20356  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20357  __pyx_v_i = __pyx_t_1;
20358 
20359  /* "View.MemoryView":1347
20360  *
20361  * for i in range(ndim - 1, -1, -1):
20362  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
20363  * mslice.strides[i + offset] = mslice.strides[i]
20364  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20365  */
20366  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20367 
20368  /* "View.MemoryView":1348
20369  * for i in range(ndim - 1, -1, -1):
20370  * mslice.shape[i + offset] = mslice.shape[i]
20371  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
20372  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20373  *
20374  */
20375  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20376 
20377  /* "View.MemoryView":1349
20378  * mslice.shape[i + offset] = mslice.shape[i]
20379  * mslice.strides[i + offset] = mslice.strides[i]
20380  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
20381  *
20382  * for i in range(offset):
20383  */
20384  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20385  }
20386 
20387  /* "View.MemoryView":1351
20388  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20389  *
20390  * for i in range(offset): # <<<<<<<<<<<<<<
20391  * mslice.shape[i] = 1
20392  * mslice.strides[i] = mslice.strides[0]
20393  */
20394  __pyx_t_1 = __pyx_v_offset;
20395  __pyx_t_2 = __pyx_t_1;
20396  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20397  __pyx_v_i = __pyx_t_3;
20398 
20399  /* "View.MemoryView":1352
20400  *
20401  * for i in range(offset):
20402  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
20403  * mslice.strides[i] = mslice.strides[0]
20404  * mslice.suboffsets[i] = -1
20405  */
20406  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20407 
20408  /* "View.MemoryView":1353
20409  * for i in range(offset):
20410  * mslice.shape[i] = 1
20411  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
20412  * mslice.suboffsets[i] = -1
20413  *
20414  */
20415  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20416 
20417  /* "View.MemoryView":1354
20418  * mslice.shape[i] = 1
20419  * mslice.strides[i] = mslice.strides[0]
20420  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
20421  *
20422  *
20423  */
20424  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
20425  }
20426 
20427  /* "View.MemoryView":1340
20428  *
20429  * @cname('__pyx_memoryview_broadcast_leading')
20430  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20431  * int ndim,
20432  * int ndim_other) nogil:
20433  */
20434 
20435  /* function exit code */
20436 }
20437 
20438 /* "View.MemoryView":1362
20439  *
20440  * @cname('__pyx_memoryview_refcount_copying')
20441  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20442  * int ndim, bint inc) nogil:
20443  *
20444  */
20445 
20446 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
20447  int __pyx_t_1;
20448 
20449  /* "View.MemoryView":1366
20450  *
20451  *
20452  * if dtype_is_object: # <<<<<<<<<<<<<<
20453  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20454  * dst.strides, ndim, inc)
20455  */
20456  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20457  if (__pyx_t_1) {
20458 
20459  /* "View.MemoryView":1367
20460  *
20461  * if dtype_is_object:
20462  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
20463  * dst.strides, ndim, inc)
20464  *
20465  */
20466  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
20467 
20468  /* "View.MemoryView":1366
20469  *
20470  *
20471  * if dtype_is_object: # <<<<<<<<<<<<<<
20472  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20473  * dst.strides, ndim, inc)
20474  */
20475  }
20476 
20477  /* "View.MemoryView":1362
20478  *
20479  * @cname('__pyx_memoryview_refcount_copying')
20480  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20481  * int ndim, bint inc) nogil:
20482  *
20483  */
20484 
20485  /* function exit code */
20486 }
20487 
20488 /* "View.MemoryView":1371
20489  *
20490  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20491  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20492  * Py_ssize_t *strides, int ndim,
20493  * bint inc) with gil:
20494  */
20495 
20496 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20497  __Pyx_RefNannyDeclarations
20498  #ifdef WITH_THREAD
20499  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20500  #endif
20501  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
20502 
20503  /* "View.MemoryView":1374
20504  * Py_ssize_t *strides, int ndim,
20505  * bint inc) with gil:
20506  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
20507  *
20508  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20509  */
20510  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20511 
20512  /* "View.MemoryView":1371
20513  *
20514  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20515  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20516  * Py_ssize_t *strides, int ndim,
20517  * bint inc) with gil:
20518  */
20519 
20520  /* function exit code */
20521  __Pyx_RefNannyFinishContext();
20522  #ifdef WITH_THREAD
20523  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20524  #endif
20525 }
20526 
20527 /* "View.MemoryView":1377
20528  *
20529  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20530  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20531  * Py_ssize_t *strides, int ndim, bint inc):
20532  * cdef Py_ssize_t i
20533  */
20534 
20535 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20536  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20537  __Pyx_RefNannyDeclarations
20538  Py_ssize_t __pyx_t_1;
20539  Py_ssize_t __pyx_t_2;
20540  Py_ssize_t __pyx_t_3;
20541  int __pyx_t_4;
20542  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
20543 
20544  /* "View.MemoryView":1381
20545  * cdef Py_ssize_t i
20546  *
20547  * for i in range(shape[0]): # <<<<<<<<<<<<<<
20548  * if ndim == 1:
20549  * if inc:
20550  */
20551  __pyx_t_1 = (__pyx_v_shape[0]);
20552  __pyx_t_2 = __pyx_t_1;
20553  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20554  __pyx_v_i = __pyx_t_3;
20555 
20556  /* "View.MemoryView":1382
20557  *
20558  * for i in range(shape[0]):
20559  * if ndim == 1: # <<<<<<<<<<<<<<
20560  * if inc:
20561  * Py_INCREF((<PyObject **> data)[0])
20562  */
20563  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20564  if (__pyx_t_4) {
20565 
20566  /* "View.MemoryView":1383
20567  * for i in range(shape[0]):
20568  * if ndim == 1:
20569  * if inc: # <<<<<<<<<<<<<<
20570  * Py_INCREF((<PyObject **> data)[0])
20571  * else:
20572  */
20573  __pyx_t_4 = (__pyx_v_inc != 0);
20574  if (__pyx_t_4) {
20575 
20576  /* "View.MemoryView":1384
20577  * if ndim == 1:
20578  * if inc:
20579  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20580  * else:
20581  * Py_DECREF((<PyObject **> data)[0])
20582  */
20583  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20584 
20585  /* "View.MemoryView":1383
20586  * for i in range(shape[0]):
20587  * if ndim == 1:
20588  * if inc: # <<<<<<<<<<<<<<
20589  * Py_INCREF((<PyObject **> data)[0])
20590  * else:
20591  */
20592  goto __pyx_L6;
20593  }
20594 
20595  /* "View.MemoryView":1386
20596  * Py_INCREF((<PyObject **> data)[0])
20597  * else:
20598  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20599  * else:
20600  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20601  */
20602  /*else*/ {
20603  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20604  }
20605  __pyx_L6:;
20606 
20607  /* "View.MemoryView":1382
20608  *
20609  * for i in range(shape[0]):
20610  * if ndim == 1: # <<<<<<<<<<<<<<
20611  * if inc:
20612  * Py_INCREF((<PyObject **> data)[0])
20613  */
20614  goto __pyx_L5;
20615  }
20616 
20617  /* "View.MemoryView":1388
20618  * Py_DECREF((<PyObject **> data)[0])
20619  * else:
20620  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20621  * ndim - 1, inc)
20622  *
20623  */
20624  /*else*/ {
20625 
20626  /* "View.MemoryView":1389
20627  * else:
20628  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20629  * ndim - 1, inc) # <<<<<<<<<<<<<<
20630  *
20631  * data += strides[0]
20632  */
20633  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20634  }
20635  __pyx_L5:;
20636 
20637  /* "View.MemoryView":1391
20638  * ndim - 1, inc)
20639  *
20640  * data += strides[0] # <<<<<<<<<<<<<<
20641  *
20642  *
20643  */
20644  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20645  }
20646 
20647  /* "View.MemoryView":1377
20648  *
20649  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20650  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20651  * Py_ssize_t *strides, int ndim, bint inc):
20652  * cdef Py_ssize_t i
20653  */
20654 
20655  /* function exit code */
20656  __Pyx_RefNannyFinishContext();
20657 }
20658 
20659 /* "View.MemoryView":1397
20660  *
20661  * @cname('__pyx_memoryview_slice_assign_scalar')
20662  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20663  * size_t itemsize, void *item,
20664  * bint dtype_is_object) nogil:
20665  */
20666 
20667 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
20668 
20669  /* "View.MemoryView":1400
20670  * size_t itemsize, void *item,
20671  * bint dtype_is_object) nogil:
20672  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20673  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20674  * itemsize, item)
20675  */
20676  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20677 
20678  /* "View.MemoryView":1401
20679  * bint dtype_is_object) nogil:
20680  * refcount_copying(dst, dtype_is_object, ndim, False)
20681  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
20682  * itemsize, item)
20683  * refcount_copying(dst, dtype_is_object, ndim, True)
20684  */
20685  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
20686 
20687  /* "View.MemoryView":1403
20688  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20689  * itemsize, item)
20690  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20691  *
20692  *
20693  */
20694  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20695 
20696  /* "View.MemoryView":1397
20697  *
20698  * @cname('__pyx_memoryview_slice_assign_scalar')
20699  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20700  * size_t itemsize, void *item,
20701  * bint dtype_is_object) nogil:
20702  */
20703 
20704  /* function exit code */
20705 }
20706 
20707 /* "View.MemoryView":1407
20708  *
20709  * @cname('__pyx_memoryview__slice_assign_scalar')
20710  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20711  * Py_ssize_t *strides, int ndim,
20712  * size_t itemsize, void *item) nogil:
20713  */
20714 
20715 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
20716  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20717  Py_ssize_t __pyx_v_stride;
20718  Py_ssize_t __pyx_v_extent;
20719  int __pyx_t_1;
20720  Py_ssize_t __pyx_t_2;
20721  Py_ssize_t __pyx_t_3;
20722  Py_ssize_t __pyx_t_4;
20723 
20724  /* "View.MemoryView":1411
20725  * size_t itemsize, void *item) nogil:
20726  * cdef Py_ssize_t i
20727  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
20728  * cdef Py_ssize_t extent = shape[0]
20729  *
20730  */
20731  __pyx_v_stride = (__pyx_v_strides[0]);
20732 
20733  /* "View.MemoryView":1412
20734  * cdef Py_ssize_t i
20735  * cdef Py_ssize_t stride = strides[0]
20736  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
20737  *
20738  * if ndim == 1:
20739  */
20740  __pyx_v_extent = (__pyx_v_shape[0]);
20741 
20742  /* "View.MemoryView":1414
20743  * cdef Py_ssize_t extent = shape[0]
20744  *
20745  * if ndim == 1: # <<<<<<<<<<<<<<
20746  * for i in range(extent):
20747  * memcpy(data, item, itemsize)
20748  */
20749  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20750  if (__pyx_t_1) {
20751 
20752  /* "View.MemoryView":1415
20753  *
20754  * if ndim == 1:
20755  * for i in range(extent): # <<<<<<<<<<<<<<
20756  * memcpy(data, item, itemsize)
20757  * data += stride
20758  */
20759  __pyx_t_2 = __pyx_v_extent;
20760  __pyx_t_3 = __pyx_t_2;
20761  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20762  __pyx_v_i = __pyx_t_4;
20763 
20764  /* "View.MemoryView":1416
20765  * if ndim == 1:
20766  * for i in range(extent):
20767  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
20768  * data += stride
20769  * else:
20770  */
20771  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20772 
20773  /* "View.MemoryView":1417
20774  * for i in range(extent):
20775  * memcpy(data, item, itemsize)
20776  * data += stride # <<<<<<<<<<<<<<
20777  * else:
20778  * for i in range(extent):
20779  */
20780  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20781  }
20782 
20783  /* "View.MemoryView":1414
20784  * cdef Py_ssize_t extent = shape[0]
20785  *
20786  * if ndim == 1: # <<<<<<<<<<<<<<
20787  * for i in range(extent):
20788  * memcpy(data, item, itemsize)
20789  */
20790  goto __pyx_L3;
20791  }
20792 
20793  /* "View.MemoryView":1419
20794  * data += stride
20795  * else:
20796  * for i in range(extent): # <<<<<<<<<<<<<<
20797  * _slice_assign_scalar(data, shape + 1, strides + 1,
20798  * ndim - 1, itemsize, item)
20799  */
20800  /*else*/ {
20801  __pyx_t_2 = __pyx_v_extent;
20802  __pyx_t_3 = __pyx_t_2;
20803  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20804  __pyx_v_i = __pyx_t_4;
20805 
20806  /* "View.MemoryView":1420
20807  * else:
20808  * for i in range(extent):
20809  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20810  * ndim - 1, itemsize, item)
20811  * data += stride
20812  */
20813  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20814 
20815  /* "View.MemoryView":1422
20816  * _slice_assign_scalar(data, shape + 1, strides + 1,
20817  * ndim - 1, itemsize, item)
20818  * data += stride # <<<<<<<<<<<<<<
20819  *
20820  *
20821  */
20822  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20823  }
20824  }
20825  __pyx_L3:;
20826 
20827  /* "View.MemoryView":1407
20828  *
20829  * @cname('__pyx_memoryview__slice_assign_scalar')
20830  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20831  * Py_ssize_t *strides, int ndim,
20832  * size_t itemsize, void *item) nogil:
20833  */
20834 
20835  /* function exit code */
20836 }
20837 
20838 /* "(tree fragment)":1
20839  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20840  * cdef object __pyx_PickleError
20841  * cdef object __pyx_result
20842  */
20843 
20844 /* Python wrapper */
20845 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20846 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20847 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20848  PyObject *__pyx_v___pyx_type = 0;
20849  long __pyx_v___pyx_checksum;
20850  PyObject *__pyx_v___pyx_state = 0;
20851  PyObject *__pyx_r = 0;
20852  __Pyx_RefNannyDeclarations
20853  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
20854  {
20855  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20856  PyObject* values[3] = {0,0,0};
20857  if (unlikely(__pyx_kwds)) {
20858  Py_ssize_t kw_args;
20859  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20860  switch (pos_args) {
20861  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20862  CYTHON_FALLTHROUGH;
20863  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20864  CYTHON_FALLTHROUGH;
20865  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20866  CYTHON_FALLTHROUGH;
20867  case 0: break;
20868  default: goto __pyx_L5_argtuple_error;
20869  }
20870  kw_args = PyDict_Size(__pyx_kwds);
20871  switch (pos_args) {
20872  case 0:
20873  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20874  else goto __pyx_L5_argtuple_error;
20875  CYTHON_FALLTHROUGH;
20876  case 1:
20877  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20878  else {
20879  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20880  }
20881  CYTHON_FALLTHROUGH;
20882  case 2:
20883  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20884  else {
20885  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20886  }
20887  }
20888  if (unlikely(kw_args > 0)) {
20889  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20890  }
20891  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20892  goto __pyx_L5_argtuple_error;
20893  } else {
20894  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20895  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20896  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20897  }
20898  __pyx_v___pyx_type = values[0];
20899  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20900  __pyx_v___pyx_state = values[2];
20901  }
20902  goto __pyx_L4_argument_unpacking_done;
20903  __pyx_L5_argtuple_error:;
20904  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20905  __pyx_L3_error:;
20906  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20907  __Pyx_RefNannyFinishContext();
20908  return NULL;
20909  __pyx_L4_argument_unpacking_done:;
20910  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20911 
20912  /* function exit code */
20913  __Pyx_RefNannyFinishContext();
20914  return __pyx_r;
20915 }
20916 
20917 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20918  PyObject *__pyx_v___pyx_PickleError = 0;
20919  PyObject *__pyx_v___pyx_result = 0;
20920  PyObject *__pyx_r = NULL;
20921  __Pyx_RefNannyDeclarations
20922  int __pyx_t_1;
20923  PyObject *__pyx_t_2 = NULL;
20924  PyObject *__pyx_t_3 = NULL;
20925  PyObject *__pyx_t_4 = NULL;
20926  PyObject *__pyx_t_5 = NULL;
20927  int __pyx_t_6;
20928  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
20929 
20930  /* "(tree fragment)":4
20931  * cdef object __pyx_PickleError
20932  * cdef object __pyx_result
20933  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
20934  * from pickle import PickleError as __pyx_PickleError
20935  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20936  */
20937  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
20938  if (__pyx_t_1) {
20939 
20940  /* "(tree fragment)":5
20941  * cdef object __pyx_result
20942  * if __pyx_checksum != 0xb068931:
20943  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
20944  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20945  * __pyx_result = Enum.__new__(__pyx_type)
20946  */
20947  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
20948  __Pyx_GOTREF(__pyx_t_2);
20949  __Pyx_INCREF(__pyx_n_s_PickleError);
20950  __Pyx_GIVEREF(__pyx_n_s_PickleError);
20951  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
20952  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
20953  __Pyx_GOTREF(__pyx_t_3);
20954  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20955  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
20956  __Pyx_GOTREF(__pyx_t_2);
20957  __Pyx_INCREF(__pyx_t_2);
20958  __pyx_v___pyx_PickleError = __pyx_t_2;
20959  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20960  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20961 
20962  /* "(tree fragment)":6
20963  * if __pyx_checksum != 0xb068931:
20964  * from pickle import PickleError as __pyx_PickleError
20965  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
20966  * __pyx_result = Enum.__new__(__pyx_type)
20967  * if __pyx_state is not None:
20968  */
20969  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
20970  __Pyx_GOTREF(__pyx_t_2);
20971  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
20972  __Pyx_GOTREF(__pyx_t_4);
20973  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20974  __Pyx_INCREF(__pyx_v___pyx_PickleError);
20975  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
20976  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
20977  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
20978  if (likely(__pyx_t_5)) {
20979  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20980  __Pyx_INCREF(__pyx_t_5);
20981  __Pyx_INCREF(function);
20982  __Pyx_DECREF_SET(__pyx_t_2, function);
20983  }
20984  }
20985  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
20986  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20987  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20988  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
20989  __Pyx_GOTREF(__pyx_t_3);
20990  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20991  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20992  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20993  __PYX_ERR(1, 6, __pyx_L1_error)
20994 
20995  /* "(tree fragment)":4
20996  * cdef object __pyx_PickleError
20997  * cdef object __pyx_result
20998  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
20999  * from pickle import PickleError as __pyx_PickleError
21000  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21001  */
21002  }
21003 
21004  /* "(tree fragment)":7
21005  * from pickle import PickleError as __pyx_PickleError
21006  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21007  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
21008  * if __pyx_state is not None:
21009  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21010  */
21011  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
21012  __Pyx_GOTREF(__pyx_t_2);
21013  __pyx_t_4 = NULL;
21014  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
21015  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
21016  if (likely(__pyx_t_4)) {
21017  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21018  __Pyx_INCREF(__pyx_t_4);
21019  __Pyx_INCREF(function);
21020  __Pyx_DECREF_SET(__pyx_t_2, function);
21021  }
21022  }
21023  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
21024  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21025  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
21026  __Pyx_GOTREF(__pyx_t_3);
21027  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21028  __pyx_v___pyx_result = __pyx_t_3;
21029  __pyx_t_3 = 0;
21030 
21031  /* "(tree fragment)":8
21032  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21033  * __pyx_result = Enum.__new__(__pyx_type)
21034  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21035  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21036  * return __pyx_result
21037  */
21038  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
21039  __pyx_t_6 = (__pyx_t_1 != 0);
21040  if (__pyx_t_6) {
21041 
21042  /* "(tree fragment)":9
21043  * __pyx_result = Enum.__new__(__pyx_type)
21044  * if __pyx_state is not None:
21045  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
21046  * return __pyx_result
21047  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21048  */
21049  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
21050  __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
21051  __Pyx_GOTREF(__pyx_t_3);
21052  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21053 
21054  /* "(tree fragment)":8
21055  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
21056  * __pyx_result = Enum.__new__(__pyx_type)
21057  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21058  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21059  * return __pyx_result
21060  */
21061  }
21062 
21063  /* "(tree fragment)":10
21064  * if __pyx_state is not None:
21065  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21066  * return __pyx_result # <<<<<<<<<<<<<<
21067  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21068  * __pyx_result.name = __pyx_state[0]
21069  */
21070  __Pyx_XDECREF(__pyx_r);
21071  __Pyx_INCREF(__pyx_v___pyx_result);
21072  __pyx_r = __pyx_v___pyx_result;
21073  goto __pyx_L0;
21074 
21075  /* "(tree fragment)":1
21076  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21077  * cdef object __pyx_PickleError
21078  * cdef object __pyx_result
21079  */
21080 
21081  /* function exit code */
21082  __pyx_L1_error:;
21083  __Pyx_XDECREF(__pyx_t_2);
21084  __Pyx_XDECREF(__pyx_t_3);
21085  __Pyx_XDECREF(__pyx_t_4);
21086  __Pyx_XDECREF(__pyx_t_5);
21087  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21088  __pyx_r = NULL;
21089  __pyx_L0:;
21090  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21091  __Pyx_XDECREF(__pyx_v___pyx_result);
21092  __Pyx_XGIVEREF(__pyx_r);
21093  __Pyx_RefNannyFinishContext();
21094  return __pyx_r;
21095 }
21096 
21097 /* "(tree fragment)":11
21098  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21099  * return __pyx_result
21100  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21101  * __pyx_result.name = __pyx_state[0]
21102  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21103  */
21104 
21105 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21106  PyObject *__pyx_r = NULL;
21107  __Pyx_RefNannyDeclarations
21108  PyObject *__pyx_t_1 = NULL;
21109  int __pyx_t_2;
21110  Py_ssize_t __pyx_t_3;
21111  int __pyx_t_4;
21112  int __pyx_t_5;
21113  PyObject *__pyx_t_6 = NULL;
21114  PyObject *__pyx_t_7 = NULL;
21115  PyObject *__pyx_t_8 = NULL;
21116  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
21117 
21118  /* "(tree fragment)":12
21119  * return __pyx_result
21120  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21121  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
21122  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21123  * __pyx_result.__dict__.update(__pyx_state[1])
21124  */
21125  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21126  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21127  __PYX_ERR(1, 12, __pyx_L1_error)
21128  }
21129  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21130  __Pyx_GOTREF(__pyx_t_1);
21131  __Pyx_GIVEREF(__pyx_t_1);
21132  __Pyx_GOTREF(__pyx_v___pyx_result->name);
21133  __Pyx_DECREF(__pyx_v___pyx_result->name);
21134  __pyx_v___pyx_result->name = __pyx_t_1;
21135  __pyx_t_1 = 0;
21136 
21137  /* "(tree fragment)":13
21138  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21139  * __pyx_result.name = __pyx_state[0]
21140  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21141  * __pyx_result.__dict__.update(__pyx_state[1])
21142  */
21143  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21144  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
21145  __PYX_ERR(1, 13, __pyx_L1_error)
21146  }
21147  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21148  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21149  if (__pyx_t_4) {
21150  } else {
21151  __pyx_t_2 = __pyx_t_4;
21152  goto __pyx_L4_bool_binop_done;
21153  }
21154  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21155  __pyx_t_5 = (__pyx_t_4 != 0);
21156  __pyx_t_2 = __pyx_t_5;
21157  __pyx_L4_bool_binop_done:;
21158  if (__pyx_t_2) {
21159 
21160  /* "(tree fragment)":14
21161  * __pyx_result.name = __pyx_state[0]
21162  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21163  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
21164  */
21165  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21166  __Pyx_GOTREF(__pyx_t_6);
21167  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
21168  __Pyx_GOTREF(__pyx_t_7);
21169  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21170  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21171  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21172  __PYX_ERR(1, 14, __pyx_L1_error)
21173  }
21174  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21175  __Pyx_GOTREF(__pyx_t_6);
21176  __pyx_t_8 = NULL;
21177  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21178  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21179  if (likely(__pyx_t_8)) {
21180  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
21181  __Pyx_INCREF(__pyx_t_8);
21182  __Pyx_INCREF(function);
21183  __Pyx_DECREF_SET(__pyx_t_7, function);
21184  }
21185  }
21186  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
21187  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21188  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21189  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
21190  __Pyx_GOTREF(__pyx_t_1);
21191  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21192  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21193 
21194  /* "(tree fragment)":13
21195  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21196  * __pyx_result.name = __pyx_state[0]
21197  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21198  * __pyx_result.__dict__.update(__pyx_state[1])
21199  */
21200  }
21201 
21202  /* "(tree fragment)":11
21203  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21204  * return __pyx_result
21205  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21206  * __pyx_result.name = __pyx_state[0]
21207  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21208  */
21209 
21210  /* function exit code */
21211  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21212  goto __pyx_L0;
21213  __pyx_L1_error:;
21214  __Pyx_XDECREF(__pyx_t_1);
21215  __Pyx_XDECREF(__pyx_t_6);
21216  __Pyx_XDECREF(__pyx_t_7);
21217  __Pyx_XDECREF(__pyx_t_8);
21218  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21219  __pyx_r = 0;
21220  __pyx_L0:;
21221  __Pyx_XGIVEREF(__pyx_r);
21222  __Pyx_RefNannyFinishContext();
21223  return __pyx_r;
21224 }
21225 
21226 static PyObject *__pyx_tp_new_15superluWrappers_cSparseMatrix(PyTypeObject *t, PyObject *a, PyObject *k) {
21227  PyObject *o;
21228  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21229  o = (*t->tp_alloc)(t, 0);
21230  } else {
21231  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21232  }
21233  if (unlikely(!o)) return 0;
21234  if (unlikely(__pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(o, a, k) < 0)) goto bad;
21235  return o;
21236  bad:
21237  Py_DECREF(o); o = 0;
21238  return NULL;
21239 }
21240 
21241 static void __pyx_tp_dealloc_15superluWrappers_cSparseMatrix(PyObject *o) {
21242  #if CYTHON_USE_TP_FINALIZE
21243  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21244  if (PyObject_CallFinalizerFromDealloc(o)) return;
21245  }
21246  #endif
21247  (*Py_TYPE(o)->tp_free)(o);
21248 }
21249 
21250 static PyMethodDef __pyx_methods_15superluWrappers_cSparseMatrix[] = {
21251  {"__reduce_cython__", (PyCFunction)__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__, METH_NOARGS, 0},
21252  {"__setstate_cython__", (PyCFunction)__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__, METH_O, 0},
21253  {0, 0, 0, 0}
21254 };
21255 
21256 static PyTypeObject __pyx_type_15superluWrappers_cSparseMatrix = {
21257  PyVarObject_HEAD_INIT(0, 0)
21258  "superluWrappers.cSparseMatrix", /*tp_name*/
21259  sizeof(struct __pyx_obj_15superluWrappers_cSparseMatrix), /*tp_basicsize*/
21260  0, /*tp_itemsize*/
21261  __pyx_tp_dealloc_15superluWrappers_cSparseMatrix, /*tp_dealloc*/
21262  #if PY_VERSION_HEX < 0x030800b4
21263  0, /*tp_print*/
21264  #endif
21265  #if PY_VERSION_HEX >= 0x030800b4
21266  0, /*tp_vectorcall_offset*/
21267  #endif
21268  0, /*tp_getattr*/
21269  0, /*tp_setattr*/
21270  #if PY_MAJOR_VERSION < 3
21271  0, /*tp_compare*/
21272  #endif
21273  #if PY_MAJOR_VERSION >= 3
21274  0, /*tp_as_async*/
21275  #endif
21276  0, /*tp_repr*/
21277  0, /*tp_as_number*/
21278  0, /*tp_as_sequence*/
21279  0, /*tp_as_mapping*/
21280  0, /*tp_hash*/
21281  0, /*tp_call*/
21282  0, /*tp_str*/
21283  0, /*tp_getattro*/
21284  0, /*tp_setattro*/
21285  0, /*tp_as_buffer*/
21286  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21287  0, /*tp_doc*/
21288  0, /*tp_traverse*/
21289  0, /*tp_clear*/
21290  0, /*tp_richcompare*/
21291  0, /*tp_weaklistoffset*/
21292  0, /*tp_iter*/
21293  0, /*tp_iternext*/
21294  __pyx_methods_15superluWrappers_cSparseMatrix, /*tp_methods*/
21295  0, /*tp_members*/
21296  0, /*tp_getset*/
21297  0, /*tp_base*/
21298  0, /*tp_dict*/
21299  0, /*tp_descr_get*/
21300  0, /*tp_descr_set*/
21301  0, /*tp_dictoffset*/
21302  0, /*tp_init*/
21303  0, /*tp_alloc*/
21304  __pyx_tp_new_15superluWrappers_cSparseMatrix, /*tp_new*/
21305  0, /*tp_free*/
21306  0, /*tp_is_gc*/
21307  0, /*tp_bases*/
21308  0, /*tp_mro*/
21309  0, /*tp_cache*/
21310  0, /*tp_subclasses*/
21311  0, /*tp_weaklist*/
21312  0, /*tp_del*/
21313  0, /*tp_version_tag*/
21314  #if PY_VERSION_HEX >= 0x030400a1
21315  0, /*tp_finalize*/
21316  #endif
21317  #if PY_VERSION_HEX >= 0x030800b1
21318  0, /*tp_vectorcall*/
21319  #endif
21320  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21321  0, /*tp_print*/
21322  #endif
21323 };
21324 static struct __pyx_vtabstruct_15superluWrappers_SparseFactor __pyx_vtable_15superluWrappers_SparseFactor;
21325 
21326 static PyObject *__pyx_tp_new_15superluWrappers_SparseFactor(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21327  struct __pyx_obj_15superluWrappers_SparseFactor *p;
21328  PyObject *o;
21329  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21330  o = (*t->tp_alloc)(t, 0);
21331  } else {
21332  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21333  }
21334  if (unlikely(!o)) return 0;
21335  p = ((struct __pyx_obj_15superluWrappers_SparseFactor *)o);
21336  p->__pyx_vtab = __pyx_vtabptr_15superluWrappers_SparseFactor;
21337  return o;
21338 }
21339 
21340 static void __pyx_tp_dealloc_15superluWrappers_SparseFactor(PyObject *o) {
21341  #if CYTHON_USE_TP_FINALIZE
21342  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21343  if (PyObject_CallFinalizerFromDealloc(o)) return;
21344  }
21345  #endif
21346  (*Py_TYPE(o)->tp_free)(o);
21347 }
21348 
21349 static PyObject *__pyx_getprop_15superluWrappers_12SparseFactor_dim(PyObject *o, CYTHON_UNUSED void *x) {
21350  return __pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(o);
21351 }
21352 
21353 static int __pyx_setprop_15superluWrappers_12SparseFactor_dim(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21354  if (v) {
21355  return __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(o, v);
21356  }
21357  else {
21358  PyErr_SetString(PyExc_NotImplementedError, "__del__");
21359  return -1;
21360  }
21361 }
21362 
21363 static PyMethodDef __pyx_methods_15superluWrappers_SparseFactor[] = {
21364  {"__reduce_cython__", (PyCFunction)__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__, METH_NOARGS, 0},
21365  {"__setstate_cython__", (PyCFunction)__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__, METH_O, 0},
21366  {0, 0, 0, 0}
21367 };
21368 
21369 static struct PyGetSetDef __pyx_getsets_15superluWrappers_SparseFactor[] = {
21370  {(char *)"dim", __pyx_getprop_15superluWrappers_12SparseFactor_dim, __pyx_setprop_15superluWrappers_12SparseFactor_dim, (char *)0, 0},
21371  {0, 0, 0, 0, 0}
21372 };
21373 
21374 static PyTypeObject __pyx_type_15superluWrappers_SparseFactor = {
21375  PyVarObject_HEAD_INIT(0, 0)
21376  "superluWrappers.SparseFactor", /*tp_name*/
21377  sizeof(struct __pyx_obj_15superluWrappers_SparseFactor), /*tp_basicsize*/
21378  0, /*tp_itemsize*/
21379  __pyx_tp_dealloc_15superluWrappers_SparseFactor, /*tp_dealloc*/
21380  #if PY_VERSION_HEX < 0x030800b4
21381  0, /*tp_print*/
21382  #endif
21383  #if PY_VERSION_HEX >= 0x030800b4
21384  0, /*tp_vectorcall_offset*/
21385  #endif
21386  0, /*tp_getattr*/
21387  0, /*tp_setattr*/
21388  #if PY_MAJOR_VERSION < 3
21389  0, /*tp_compare*/
21390  #endif
21391  #if PY_MAJOR_VERSION >= 3
21392  0, /*tp_as_async*/
21393  #endif
21394  0, /*tp_repr*/
21395  0, /*tp_as_number*/
21396  0, /*tp_as_sequence*/
21397  0, /*tp_as_mapping*/
21398  0, /*tp_hash*/
21399  0, /*tp_call*/
21400  0, /*tp_str*/
21401  0, /*tp_getattro*/
21402  0, /*tp_setattro*/
21403  0, /*tp_as_buffer*/
21404  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21405  0, /*tp_doc*/
21406  0, /*tp_traverse*/
21407  0, /*tp_clear*/
21408  0, /*tp_richcompare*/
21409  0, /*tp_weaklistoffset*/
21410  0, /*tp_iter*/
21411  0, /*tp_iternext*/
21412  __pyx_methods_15superluWrappers_SparseFactor, /*tp_methods*/
21413  0, /*tp_members*/
21414  __pyx_getsets_15superluWrappers_SparseFactor, /*tp_getset*/
21415  0, /*tp_base*/
21416  0, /*tp_dict*/
21417  0, /*tp_descr_get*/
21418  0, /*tp_descr_set*/
21419  0, /*tp_dictoffset*/
21420  __pyx_pw_15superluWrappers_12SparseFactor_1__init__, /*tp_init*/
21421  0, /*tp_alloc*/
21422  __pyx_tp_new_15superluWrappers_SparseFactor, /*tp_new*/
21423  0, /*tp_free*/
21424  0, /*tp_is_gc*/
21425  0, /*tp_bases*/
21426  0, /*tp_mro*/
21427  0, /*tp_cache*/
21428  0, /*tp_subclasses*/
21429  0, /*tp_weaklist*/
21430  0, /*tp_del*/
21431  0, /*tp_version_tag*/
21432  #if PY_VERSION_HEX >= 0x030400a1
21433  0, /*tp_finalize*/
21434  #endif
21435  #if PY_VERSION_HEX >= 0x030800b1
21436  0, /*tp_vectorcall*/
21437  #endif
21438  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21439  0, /*tp_print*/
21440  #endif
21441 };
21442 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21443 
21444 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21445  struct __pyx_array_obj *p;
21446  PyObject *o;
21447  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21448  o = (*t->tp_alloc)(t, 0);
21449  } else {
21450  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21451  }
21452  if (unlikely(!o)) return 0;
21453  p = ((struct __pyx_array_obj *)o);
21454  p->__pyx_vtab = __pyx_vtabptr_array;
21455  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21456  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21457  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
21458  return o;
21459  bad:
21460  Py_DECREF(o); o = 0;
21461  return NULL;
21462 }
21463 
21464 static void __pyx_tp_dealloc_array(PyObject *o) {
21465  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
21466  #if CYTHON_USE_TP_FINALIZE
21467  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21468  if (PyObject_CallFinalizerFromDealloc(o)) return;
21469  }
21470  #endif
21471  {
21472  PyObject *etype, *eval, *etb;
21473  PyErr_Fetch(&etype, &eval, &etb);
21474  ++Py_REFCNT(o);
21475  __pyx_array___dealloc__(o);
21476  --Py_REFCNT(o);
21477  PyErr_Restore(etype, eval, etb);
21478  }
21479  Py_CLEAR(p->mode);
21480  Py_CLEAR(p->_format);
21481  (*Py_TYPE(o)->tp_free)(o);
21482 }
21483 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21484  PyObject *r;
21485  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21486  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21487  Py_DECREF(x);
21488  return r;
21489 }
21490 
21491 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
21492  if (v) {
21493  return __pyx_array___setitem__(o, i, v);
21494  }
21495  else {
21496  PyErr_Format(PyExc_NotImplementedError,
21497  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21498  return -1;
21499  }
21500 }
21501 
21502 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
21503  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
21504  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21505  PyErr_Clear();
21506  v = __pyx_array___getattr__(o, n);
21507  }
21508  return v;
21509 }
21510 
21511 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
21512  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21513 }
21514 
21515 static PyMethodDef __pyx_methods_array[] = {
21516  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21517  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21518  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21519  {0, 0, 0, 0}
21520 };
21521 
21522 static struct PyGetSetDef __pyx_getsets_array[] = {
21523  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
21524  {0, 0, 0, 0, 0}
21525 };
21526 
21527 static PySequenceMethods __pyx_tp_as_sequence_array = {
21528  __pyx_array___len__, /*sq_length*/
21529  0, /*sq_concat*/
21530  0, /*sq_repeat*/
21531  __pyx_sq_item_array, /*sq_item*/
21532  0, /*sq_slice*/
21533  0, /*sq_ass_item*/
21534  0, /*sq_ass_slice*/
21535  0, /*sq_contains*/
21536  0, /*sq_inplace_concat*/
21537  0, /*sq_inplace_repeat*/
21538 };
21539 
21540 static PyMappingMethods __pyx_tp_as_mapping_array = {
21541  __pyx_array___len__, /*mp_length*/
21542  __pyx_array___getitem__, /*mp_subscript*/
21543  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
21544 };
21545 
21546 static PyBufferProcs __pyx_tp_as_buffer_array = {
21547  #if PY_MAJOR_VERSION < 3
21548  0, /*bf_getreadbuffer*/
21549  #endif
21550  #if PY_MAJOR_VERSION < 3
21551  0, /*bf_getwritebuffer*/
21552  #endif
21553  #if PY_MAJOR_VERSION < 3
21554  0, /*bf_getsegcount*/
21555  #endif
21556  #if PY_MAJOR_VERSION < 3
21557  0, /*bf_getcharbuffer*/
21558  #endif
21559  __pyx_array_getbuffer, /*bf_getbuffer*/
21560  0, /*bf_releasebuffer*/
21561 };
21562 
21563 static PyTypeObject __pyx_type___pyx_array = {
21564  PyVarObject_HEAD_INIT(0, 0)
21565  "superluWrappers.array", /*tp_name*/
21566  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
21567  0, /*tp_itemsize*/
21568  __pyx_tp_dealloc_array, /*tp_dealloc*/
21569  #if PY_VERSION_HEX < 0x030800b4
21570  0, /*tp_print*/
21571  #endif
21572  #if PY_VERSION_HEX >= 0x030800b4
21573  0, /*tp_vectorcall_offset*/
21574  #endif
21575  0, /*tp_getattr*/
21576  0, /*tp_setattr*/
21577  #if PY_MAJOR_VERSION < 3
21578  0, /*tp_compare*/
21579  #endif
21580  #if PY_MAJOR_VERSION >= 3
21581  0, /*tp_as_async*/
21582  #endif
21583  0, /*tp_repr*/
21584  0, /*tp_as_number*/
21585  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
21586  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
21587  0, /*tp_hash*/
21588  0, /*tp_call*/
21589  0, /*tp_str*/
21590  __pyx_tp_getattro_array, /*tp_getattro*/
21591  0, /*tp_setattro*/
21592  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
21593  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21594  0, /*tp_doc*/
21595  0, /*tp_traverse*/
21596  0, /*tp_clear*/
21597  0, /*tp_richcompare*/
21598  0, /*tp_weaklistoffset*/
21599  0, /*tp_iter*/
21600  0, /*tp_iternext*/
21601  __pyx_methods_array, /*tp_methods*/
21602  0, /*tp_members*/
21603  __pyx_getsets_array, /*tp_getset*/
21604  0, /*tp_base*/
21605  0, /*tp_dict*/
21606  0, /*tp_descr_get*/
21607  0, /*tp_descr_set*/
21608  0, /*tp_dictoffset*/
21609  0, /*tp_init*/
21610  0, /*tp_alloc*/
21611  __pyx_tp_new_array, /*tp_new*/
21612  0, /*tp_free*/
21613  0, /*tp_is_gc*/
21614  0, /*tp_bases*/
21615  0, /*tp_mro*/
21616  0, /*tp_cache*/
21617  0, /*tp_subclasses*/
21618  0, /*tp_weaklist*/
21619  0, /*tp_del*/
21620  0, /*tp_version_tag*/
21621  #if PY_VERSION_HEX >= 0x030400a1
21622  0, /*tp_finalize*/
21623  #endif
21624  #if PY_VERSION_HEX >= 0x030800b1
21625  0, /*tp_vectorcall*/
21626  #endif
21627  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21628  0, /*tp_print*/
21629  #endif
21630 };
21631 
21632 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21633  struct __pyx_MemviewEnum_obj *p;
21634  PyObject *o;
21635  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21636  o = (*t->tp_alloc)(t, 0);
21637  } else {
21638  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21639  }
21640  if (unlikely(!o)) return 0;
21641  p = ((struct __pyx_MemviewEnum_obj *)o);
21642  p->name = Py_None; Py_INCREF(Py_None);
21643  return o;
21644 }
21645 
21646 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21647  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21648  #if CYTHON_USE_TP_FINALIZE
21649  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21650  if (PyObject_CallFinalizerFromDealloc(o)) return;
21651  }
21652  #endif
21653  PyObject_GC_UnTrack(o);
21654  Py_CLEAR(p->name);
21655  (*Py_TYPE(o)->tp_free)(o);
21656 }
21657 
21658 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
21659  int e;
21660  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21661  if (p->name) {
21662  e = (*v)(p->name, a); if (e) return e;
21663  }
21664  return 0;
21665 }
21666 
21667 static int __pyx_tp_clear_Enum(PyObject *o) {
21668  PyObject* tmp;
21669  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21670  tmp = ((PyObject*)p->name);
21671  p->name = Py_None; Py_INCREF(Py_None);
21672  Py_XDECREF(tmp);
21673  return 0;
21674 }
21675 
21676 static PyMethodDef __pyx_methods_Enum[] = {
21677  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21678  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21679  {0, 0, 0, 0}
21680 };
21681 
21682 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
21683  PyVarObject_HEAD_INIT(0, 0)
21684  "superluWrappers.Enum", /*tp_name*/
21685  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
21686  0, /*tp_itemsize*/
21687  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
21688  #if PY_VERSION_HEX < 0x030800b4
21689  0, /*tp_print*/
21690  #endif
21691  #if PY_VERSION_HEX >= 0x030800b4
21692  0, /*tp_vectorcall_offset*/
21693  #endif
21694  0, /*tp_getattr*/
21695  0, /*tp_setattr*/
21696  #if PY_MAJOR_VERSION < 3
21697  0, /*tp_compare*/
21698  #endif
21699  #if PY_MAJOR_VERSION >= 3
21700  0, /*tp_as_async*/
21701  #endif
21702  __pyx_MemviewEnum___repr__, /*tp_repr*/
21703  0, /*tp_as_number*/
21704  0, /*tp_as_sequence*/
21705  0, /*tp_as_mapping*/
21706  0, /*tp_hash*/
21707  0, /*tp_call*/
21708  0, /*tp_str*/
21709  0, /*tp_getattro*/
21710  0, /*tp_setattro*/
21711  0, /*tp_as_buffer*/
21712  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21713  0, /*tp_doc*/
21714  __pyx_tp_traverse_Enum, /*tp_traverse*/
21715  __pyx_tp_clear_Enum, /*tp_clear*/
21716  0, /*tp_richcompare*/
21717  0, /*tp_weaklistoffset*/
21718  0, /*tp_iter*/
21719  0, /*tp_iternext*/
21720  __pyx_methods_Enum, /*tp_methods*/
21721  0, /*tp_members*/
21722  0, /*tp_getset*/
21723  0, /*tp_base*/
21724  0, /*tp_dict*/
21725  0, /*tp_descr_get*/
21726  0, /*tp_descr_set*/
21727  0, /*tp_dictoffset*/
21728  __pyx_MemviewEnum___init__, /*tp_init*/
21729  0, /*tp_alloc*/
21730  __pyx_tp_new_Enum, /*tp_new*/
21731  0, /*tp_free*/
21732  0, /*tp_is_gc*/
21733  0, /*tp_bases*/
21734  0, /*tp_mro*/
21735  0, /*tp_cache*/
21736  0, /*tp_subclasses*/
21737  0, /*tp_weaklist*/
21738  0, /*tp_del*/
21739  0, /*tp_version_tag*/
21740  #if PY_VERSION_HEX >= 0x030400a1
21741  0, /*tp_finalize*/
21742  #endif
21743  #if PY_VERSION_HEX >= 0x030800b1
21744  0, /*tp_vectorcall*/
21745  #endif
21746  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21747  0, /*tp_print*/
21748  #endif
21749 };
21750 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
21751 
21752 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
21753  struct __pyx_memoryview_obj *p;
21754  PyObject *o;
21755  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21756  o = (*t->tp_alloc)(t, 0);
21757  } else {
21758  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21759  }
21760  if (unlikely(!o)) return 0;
21761  p = ((struct __pyx_memoryview_obj *)o);
21762  p->__pyx_vtab = __pyx_vtabptr_memoryview;
21763  p->obj = Py_None; Py_INCREF(Py_None);
21764  p->_size = Py_None; Py_INCREF(Py_None);
21765  p->_array_interface = Py_None; Py_INCREF(Py_None);
21766  p->view.obj = NULL;
21767  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
21768  return o;
21769  bad:
21770  Py_DECREF(o); o = 0;
21771  return NULL;
21772 }
21773 
21774 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
21775  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21776  #if CYTHON_USE_TP_FINALIZE
21777  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21778  if (PyObject_CallFinalizerFromDealloc(o)) return;
21779  }
21780  #endif
21781  PyObject_GC_UnTrack(o);
21782  {
21783  PyObject *etype, *eval, *etb;
21784  PyErr_Fetch(&etype, &eval, &etb);
21785  ++Py_REFCNT(o);
21786  __pyx_memoryview___dealloc__(o);
21787  --Py_REFCNT(o);
21788  PyErr_Restore(etype, eval, etb);
21789  }
21790  Py_CLEAR(p->obj);
21791  Py_CLEAR(p->_size);
21792  Py_CLEAR(p->_array_interface);
21793  (*Py_TYPE(o)->tp_free)(o);
21794 }
21795 
21796 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
21797  int e;
21798  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21799  if (p->obj) {
21800  e = (*v)(p->obj, a); if (e) return e;
21801  }
21802  if (p->_size) {
21803  e = (*v)(p->_size, a); if (e) return e;
21804  }
21805  if (p->_array_interface) {
21806  e = (*v)(p->_array_interface, a); if (e) return e;
21807  }
21808  if (p->view.obj) {
21809  e = (*v)(p->view.obj, a); if (e) return e;
21810  }
21811  return 0;
21812 }
21813 
21814 static int __pyx_tp_clear_memoryview(PyObject *o) {
21815  PyObject* tmp;
21816  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21817  tmp = ((PyObject*)p->obj);
21818  p->obj = Py_None; Py_INCREF(Py_None);
21819  Py_XDECREF(tmp);
21820  tmp = ((PyObject*)p->_size);
21821  p->_size = Py_None; Py_INCREF(Py_None);
21822  Py_XDECREF(tmp);
21823  tmp = ((PyObject*)p->_array_interface);
21824  p->_array_interface = Py_None; Py_INCREF(Py_None);
21825  Py_XDECREF(tmp);
21826  Py_CLEAR(p->view.obj);
21827  return 0;
21828 }
21829 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
21830  PyObject *r;
21831  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21832  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21833  Py_DECREF(x);
21834  return r;
21835 }
21836 
21837 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
21838  if (v) {
21839  return __pyx_memoryview___setitem__(o, i, v);
21840  }
21841  else {
21842  PyErr_Format(PyExc_NotImplementedError,
21843  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21844  return -1;
21845  }
21846 }
21847 
21848 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
21849  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
21850 }
21851 
21852 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
21853  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
21854 }
21855 
21856 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
21857  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
21858 }
21859 
21860 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
21861  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
21862 }
21863 
21864 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
21865  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
21866 }
21867 
21868 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
21869  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
21870 }
21871 
21872 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
21873  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
21874 }
21875 
21876 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
21877  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
21878 }
21879 
21880 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
21881  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
21882 }
21883 
21884 static PyMethodDef __pyx_methods_memoryview[] = {
21885  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
21886  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
21887  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
21888  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
21889  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
21890  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
21891  {0, 0, 0, 0}
21892 };
21893 
21894 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
21895  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
21896  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
21897  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
21898  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
21899  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
21900  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
21901  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
21902  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
21903  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
21904  {0, 0, 0, 0, 0}
21905 };
21906 
21907 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
21908  __pyx_memoryview___len__, /*sq_length*/
21909  0, /*sq_concat*/
21910  0, /*sq_repeat*/
21911  __pyx_sq_item_memoryview, /*sq_item*/
21912  0, /*sq_slice*/
21913  0, /*sq_ass_item*/
21914  0, /*sq_ass_slice*/
21915  0, /*sq_contains*/
21916  0, /*sq_inplace_concat*/
21917  0, /*sq_inplace_repeat*/
21918 };
21919 
21920 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
21921  __pyx_memoryview___len__, /*mp_length*/
21922  __pyx_memoryview___getitem__, /*mp_subscript*/
21923  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
21924 };
21925 
21926 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
21927  #if PY_MAJOR_VERSION < 3
21928  0, /*bf_getreadbuffer*/
21929  #endif
21930  #if PY_MAJOR_VERSION < 3
21931  0, /*bf_getwritebuffer*/
21932  #endif
21933  #if PY_MAJOR_VERSION < 3
21934  0, /*bf_getsegcount*/
21935  #endif
21936  #if PY_MAJOR_VERSION < 3
21937  0, /*bf_getcharbuffer*/
21938  #endif
21939  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
21940  0, /*bf_releasebuffer*/
21941 };
21942 
21943 static PyTypeObject __pyx_type___pyx_memoryview = {
21944  PyVarObject_HEAD_INIT(0, 0)
21945  "superluWrappers.memoryview", /*tp_name*/
21946  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
21947  0, /*tp_itemsize*/
21948  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
21949  #if PY_VERSION_HEX < 0x030800b4
21950  0, /*tp_print*/
21951  #endif
21952  #if PY_VERSION_HEX >= 0x030800b4
21953  0, /*tp_vectorcall_offset*/
21954  #endif
21955  0, /*tp_getattr*/
21956  0, /*tp_setattr*/
21957  #if PY_MAJOR_VERSION < 3
21958  0, /*tp_compare*/
21959  #endif
21960  #if PY_MAJOR_VERSION >= 3
21961  0, /*tp_as_async*/
21962  #endif
21963  __pyx_memoryview___repr__, /*tp_repr*/
21964  0, /*tp_as_number*/
21965  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
21966  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
21967  0, /*tp_hash*/
21968  0, /*tp_call*/
21969  __pyx_memoryview___str__, /*tp_str*/
21970  0, /*tp_getattro*/
21971  0, /*tp_setattro*/
21972  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
21973  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21974  0, /*tp_doc*/
21975  __pyx_tp_traverse_memoryview, /*tp_traverse*/
21976  __pyx_tp_clear_memoryview, /*tp_clear*/
21977  0, /*tp_richcompare*/
21978  0, /*tp_weaklistoffset*/
21979  0, /*tp_iter*/
21980  0, /*tp_iternext*/
21981  __pyx_methods_memoryview, /*tp_methods*/
21982  0, /*tp_members*/
21983  __pyx_getsets_memoryview, /*tp_getset*/
21984  0, /*tp_base*/
21985  0, /*tp_dict*/
21986  0, /*tp_descr_get*/
21987  0, /*tp_descr_set*/
21988  0, /*tp_dictoffset*/
21989  0, /*tp_init*/
21990  0, /*tp_alloc*/
21991  __pyx_tp_new_memoryview, /*tp_new*/
21992  0, /*tp_free*/
21993  0, /*tp_is_gc*/
21994  0, /*tp_bases*/
21995  0, /*tp_mro*/
21996  0, /*tp_cache*/
21997  0, /*tp_subclasses*/
21998  0, /*tp_weaklist*/
21999  0, /*tp_del*/
22000  0, /*tp_version_tag*/
22001  #if PY_VERSION_HEX >= 0x030400a1
22002  0, /*tp_finalize*/
22003  #endif
22004  #if PY_VERSION_HEX >= 0x030800b1
22005  0, /*tp_vectorcall*/
22006  #endif
22007  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22008  0, /*tp_print*/
22009  #endif
22010 };
22011 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22012 
22013 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22014  struct __pyx_memoryviewslice_obj *p;
22015  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22016  if (unlikely(!o)) return 0;
22017  p = ((struct __pyx_memoryviewslice_obj *)o);
22018  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22019  p->from_object = Py_None; Py_INCREF(Py_None);
22020  p->from_slice.memview = NULL;
22021  return o;
22022 }
22023 
22024 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22025  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22026  #if CYTHON_USE_TP_FINALIZE
22027  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22028  if (PyObject_CallFinalizerFromDealloc(o)) return;
22029  }
22030  #endif
22031  PyObject_GC_UnTrack(o);
22032  {
22033  PyObject *etype, *eval, *etb;
22034  PyErr_Fetch(&etype, &eval, &etb);
22035  ++Py_REFCNT(o);
22036  __pyx_memoryviewslice___dealloc__(o);
22037  --Py_REFCNT(o);
22038  PyErr_Restore(etype, eval, etb);
22039  }
22040  Py_CLEAR(p->from_object);
22041  PyObject_GC_Track(o);
22042  __pyx_tp_dealloc_memoryview(o);
22043 }
22044 
22045 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
22046  int e;
22047  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22048  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
22049  if (p->from_object) {
22050  e = (*v)(p->from_object, a); if (e) return e;
22051  }
22052  return 0;
22053 }
22054 
22055 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22056  PyObject* tmp;
22057  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22058  __pyx_tp_clear_memoryview(o);
22059  tmp = ((PyObject*)p->from_object);
22060  p->from_object = Py_None; Py_INCREF(Py_None);
22061  Py_XDECREF(tmp);
22062  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22063  return 0;
22064 }
22065 
22066 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
22067  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22068 }
22069 
22070 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22071  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22072  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22073  {0, 0, 0, 0}
22074 };
22075 
22076 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22077  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
22078  {0, 0, 0, 0, 0}
22079 };
22080 
22081 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22082  PyVarObject_HEAD_INIT(0, 0)
22083  "superluWrappers._memoryviewslice", /*tp_name*/
22084  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
22085  0, /*tp_itemsize*/
22086  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
22087  #if PY_VERSION_HEX < 0x030800b4
22088  0, /*tp_print*/
22089  #endif
22090  #if PY_VERSION_HEX >= 0x030800b4
22091  0, /*tp_vectorcall_offset*/
22092  #endif
22093  0, /*tp_getattr*/
22094  0, /*tp_setattr*/
22095  #if PY_MAJOR_VERSION < 3
22096  0, /*tp_compare*/
22097  #endif
22098  #if PY_MAJOR_VERSION >= 3
22099  0, /*tp_as_async*/
22100  #endif
22101  #if CYTHON_COMPILING_IN_PYPY
22102  __pyx_memoryview___repr__, /*tp_repr*/
22103  #else
22104  0, /*tp_repr*/
22105  #endif
22106  0, /*tp_as_number*/
22107  0, /*tp_as_sequence*/
22108  0, /*tp_as_mapping*/
22109  0, /*tp_hash*/
22110  0, /*tp_call*/
22111  #if CYTHON_COMPILING_IN_PYPY
22112  __pyx_memoryview___str__, /*tp_str*/
22113  #else
22114  0, /*tp_str*/
22115  #endif
22116  0, /*tp_getattro*/
22117  0, /*tp_setattro*/
22118  0, /*tp_as_buffer*/
22119  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22120  "Internal class for passing memoryview slices to Python", /*tp_doc*/
22121  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
22122  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
22123  0, /*tp_richcompare*/
22124  0, /*tp_weaklistoffset*/
22125  0, /*tp_iter*/
22126  0, /*tp_iternext*/
22127  __pyx_methods__memoryviewslice, /*tp_methods*/
22128  0, /*tp_members*/
22129  __pyx_getsets__memoryviewslice, /*tp_getset*/
22130  0, /*tp_base*/
22131  0, /*tp_dict*/
22132  0, /*tp_descr_get*/
22133  0, /*tp_descr_set*/
22134  0, /*tp_dictoffset*/
22135  0, /*tp_init*/
22136  0, /*tp_alloc*/
22137  __pyx_tp_new__memoryviewslice, /*tp_new*/
22138  0, /*tp_free*/
22139  0, /*tp_is_gc*/
22140  0, /*tp_bases*/
22141  0, /*tp_mro*/
22142  0, /*tp_cache*/
22143  0, /*tp_subclasses*/
22144  0, /*tp_weaklist*/
22145  0, /*tp_del*/
22146  0, /*tp_version_tag*/
22147  #if PY_VERSION_HEX >= 0x030400a1
22148  0, /*tp_finalize*/
22149  #endif
22150  #if PY_VERSION_HEX >= 0x030800b1
22151  0, /*tp_vectorcall*/
22152  #endif
22153  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22154  0, /*tp_print*/
22155  #endif
22156 };
22157 
22158 static PyMethodDef __pyx_methods[] = {
22159  {0, 0, 0, 0}
22160 };
22161 
22162 #if PY_MAJOR_VERSION >= 3
22163 #if CYTHON_PEP489_MULTI_PHASE_INIT
22164 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
22165 static int __pyx_pymod_exec_superluWrappers(PyObject* module); /*proto*/
22166 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22167  {Py_mod_create, (void*)__pyx_pymod_create},
22168  {Py_mod_exec, (void*)__pyx_pymod_exec_superluWrappers},
22169  {0, NULL}
22170 };
22171 #endif
22172 
22173 static struct PyModuleDef __pyx_moduledef = {
22174  PyModuleDef_HEAD_INIT,
22175  "superluWrappers",
22176  0, /* m_doc */
22177  #if CYTHON_PEP489_MULTI_PHASE_INIT
22178  0, /* m_size */
22179  #else
22180  -1, /* m_size */
22181  #endif
22182  __pyx_methods /* m_methods */,
22183  #if CYTHON_PEP489_MULTI_PHASE_INIT
22184  __pyx_moduledef_slots, /* m_slots */
22185  #else
22186  NULL, /* m_reload */
22187  #endif
22188  NULL, /* m_traverse */
22189  NULL, /* m_clear */
22190  NULL /* m_free */
22191 };
22192 #endif
22193 #ifndef CYTHON_SMALL_CODE
22194 #if defined(__clang__)
22195  #define CYTHON_SMALL_CODE
22196 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22197  #define CYTHON_SMALL_CODE __attribute__((cold))
22198 #else
22199  #define CYTHON_SMALL_CODE
22200 #endif
22201 #endif
22202 
22203 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22204  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22205  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22206  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22207  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22208  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22209  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22210  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22211  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22212  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
22213  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
22214  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22215  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
22216  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22217  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22218  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22219  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22220  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22221  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22222  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22223  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
22224  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
22225  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22226  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22227  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
22228  {&__pyx_n_s_SparseFactor, __pyx_k_SparseFactor, sizeof(__pyx_k_SparseFactor), 0, 0, 1, 1},
22229  {&__pyx_n_s_SparseMatrix, __pyx_k_SparseMatrix, sizeof(__pyx_k_SparseMatrix), 0, 0, 1, 1},
22230  {&__pyx_n_s_SparseMatrix___init, __pyx_k_SparseMatrix___init, sizeof(__pyx_k_SparseMatrix___init), 0, 0, 1, 1},
22231  {&__pyx_n_s_SparseMatrix_fwrite, __pyx_k_SparseMatrix_fwrite, sizeof(__pyx_k_SparseMatrix_fwrite), 0, 0, 1, 1},
22232  {&__pyx_n_s_SparseMatrix_getCSRrepresentatio, __pyx_k_SparseMatrix_getCSRrepresentatio, sizeof(__pyx_k_SparseMatrix_getCSRrepresentatio), 0, 0, 1, 1},
22233  {&__pyx_n_s_SparseMatrix_getSubMatCSRreprese, __pyx_k_SparseMatrix_getSubMatCSRreprese, sizeof(__pyx_k_SparseMatrix_getSubMatCSRreprese), 0, 0, 1, 1},
22234  {&__pyx_n_s_SparseMatrix_matvec, __pyx_k_SparseMatrix_matvec, sizeof(__pyx_k_SparseMatrix_matvec), 0, 0, 1, 1},
22235  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22236  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22237  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22238  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22239  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22240  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
22241  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
22242  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
22243  {&__pyx_n_s_cSparseMatrix, __pyx_k_cSparseMatrix, sizeof(__pyx_k_cSparseMatrix), 0, 0, 1, 1},
22244  {&__pyx_n_s_cSparseMatrix_2, __pyx_k_cSparseMatrix_2, sizeof(__pyx_k_cSparseMatrix_2), 0, 0, 1, 1},
22245  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
22246  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22247  {&__pyx_n_s_colind, __pyx_k_colind, sizeof(__pyx_k_colind), 0, 0, 1, 1},
22248  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22249  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22250  {&__pyx_kp_s_d_d_13_8e, __pyx_k_d_d_13_8e, sizeof(__pyx_k_d_d_13_8e), 0, 0, 1, 0},
22251  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
22252  {&__pyx_n_s_dim, __pyx_k_dim, sizeof(__pyx_k_dim), 0, 0, 1, 1},
22253  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
22254  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22255  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
22256  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
22257  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22258  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
22259  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
22260  {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
22261  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
22262  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
22263  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22264  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22265  {&__pyx_n_s_fwrite, __pyx_k_fwrite, sizeof(__pyx_k_fwrite), 0, 0, 1, 1},
22266  {&__pyx_n_s_getCSRrepresentation, __pyx_k_getCSRrepresentation, sizeof(__pyx_k_getCSRrepresentation), 0, 0, 1, 1},
22267  {&__pyx_n_s_getSubMatCSRrepresentation, __pyx_k_getSubMatCSRrepresentation, sizeof(__pyx_k_getSubMatCSRrepresentation), 0, 0, 1, 1},
22268  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22269  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22270  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
22271  {&__pyx_kp_s_i_i_i, __pyx_k_i_i_i, sizeof(__pyx_k_i_i_i), 0, 0, 1, 0},
22272  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
22273  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
22274  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
22275  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22276  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22277  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
22278  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
22279  {&__pyx_n_s_matvec, __pyx_k_matvec, sizeof(__pyx_k_matvec), 0, 0, 1, 1},
22280  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
22281  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
22282  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
22283  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
22284  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
22285  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22286  {&__pyx_n_s_nc, __pyx_k_nc, sizeof(__pyx_k_nc), 0, 0, 1, 1},
22287  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
22288  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
22289  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22290  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
22291  {&__pyx_n_s_nnz, __pyx_k_nnz, sizeof(__pyx_k_nnz), 0, 0, 1, 1},
22292  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
22293  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
22294  {&__pyx_n_s_nr, __pyx_k_nr, sizeof(__pyx_k_nr), 0, 0, 1, 1},
22295  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22296  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
22297  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
22298  {&__pyx_n_s_nzval, __pyx_k_nzval, sizeof(__pyx_k_nzval), 0, 0, 1, 1},
22299  {&__pyx_n_s_nzvals, __pyx_k_nzvals, sizeof(__pyx_k_nzvals), 0, 0, 1, 1},
22300  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
22301  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
22302  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
22303  {&__pyx_n_s_output_file, __pyx_k_output_file, sizeof(__pyx_k_output_file), 0, 0, 1, 1},
22304  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
22305  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22306  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
22307  {&__pyx_kp_s_proteus_superluWrappers_pyx, __pyx_k_proteus_superluWrappers_pyx, sizeof(__pyx_k_proteus_superluWrappers_pyx), 0, 0, 1, 0},
22308  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22309  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22310  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22311  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22312  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22313  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22314  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22315  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22316  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
22317  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
22318  {&__pyx_n_s_range_end, __pyx_k_range_end, sizeof(__pyx_k_range_end), 0, 0, 1, 1},
22319  {&__pyx_n_s_range_start, __pyx_k_range_start, sizeof(__pyx_k_range_start), 0, 0, 1, 1},
22320  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22321  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22322  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22323  {&__pyx_n_s_rowptr, __pyx_k_rowptr, sizeof(__pyx_k_rowptr), 0, 0, 1, 1},
22324  {&__pyx_n_s_rows, __pyx_k_rows, sizeof(__pyx_k_rows), 0, 0, 1, 1},
22325  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
22326  {&__pyx_kp_s_self_A_self_AC_self_L_self_U_sel, __pyx_k_self_A_self_AC_self_L_self_U_sel, sizeof(__pyx_k_self_A_self_AC_self_L_self_U_sel), 0, 0, 1, 0},
22327  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22328  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22329  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
22330  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
22331  {&__pyx_n_s_sparseFactor, __pyx_k_sparseFactor, sizeof(__pyx_k_sparseFactor), 0, 0, 1, 1},
22332  {&__pyx_n_s_sparseFactorPrepare, __pyx_k_sparseFactorPrepare, sizeof(__pyx_k_sparseFactorPrepare), 0, 0, 1, 1},
22333  {&__pyx_n_s_sparseFactorSolve, __pyx_k_sparseFactorSolve, sizeof(__pyx_k_sparseFactorSolve), 0, 0, 1, 1},
22334  {&__pyx_n_s_sparse_matrix, __pyx_k_sparse_matrix, sizeof(__pyx_k_sparse_matrix), 0, 0, 1, 1},
22335  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
22336  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
22337  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
22338  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22339  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
22340  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22341  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22342  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
22343  {&__pyx_n_s_superluWrappers, __pyx_k_superluWrappers, sizeof(__pyx_k_superluWrappers), 0, 0, 1, 1},
22344  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
22345  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
22346  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
22347  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
22348  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22349  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
22350  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
22351  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
22352  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
22353  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
22354  {0, 0, 0, 0, 0, 0, 0}
22355 };
22356 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
22357  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 13, __pyx_L1_error)
22358  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 56, __pyx_L1_error)
22359  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 58, __pyx_L1_error)
22360  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
22361  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 272, __pyx_L1_error)
22362  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 856, __pyx_L1_error)
22363  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1038, __pyx_L1_error)
22364  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
22365  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
22366  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
22367  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
22368  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
22369  return 0;
22370  __pyx_L1_error:;
22371  return -1;
22372 }
22373 
22374 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
22375  __Pyx_RefNannyDeclarations
22376  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
22377 
22378  /* "superluWrappers.pyx":56
22379  * ?!Possibly something to do with parallel?!
22380  * """
22381  * with open(filename, 'w') as output_file: # <<<<<<<<<<<<<<
22382  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
22383  * for i in range(self.nr):
22384  */
22385  __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 56, __pyx_L1_error)
22386  __Pyx_GOTREF(__pyx_tuple_);
22387  __Pyx_GIVEREF(__pyx_tuple_);
22388 
22389  /* "(tree fragment)":2
22390  * def __reduce_cython__(self):
22391  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22392  * def __setstate_cython__(self, __pyx_state):
22393  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22394  */
22395  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 2, __pyx_L1_error)
22396  __Pyx_GOTREF(__pyx_tuple__2);
22397  __Pyx_GIVEREF(__pyx_tuple__2);
22398 
22399  /* "(tree fragment)":4
22400  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22401  * def __setstate_cython__(self, __pyx_state):
22402  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22403  */
22404  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 4, __pyx_L1_error)
22405  __Pyx_GOTREF(__pyx_tuple__3);
22406  __Pyx_GIVEREF(__pyx_tuple__3);
22407 
22408  /* "(tree fragment)":2
22409  * def __reduce_cython__(self):
22410  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
22411  * def __setstate_cython__(self, __pyx_state):
22412  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
22413  */
22414  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self_A_self_AC_self_L_self_U_sel); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 2, __pyx_L1_error)
22415  __Pyx_GOTREF(__pyx_tuple__4);
22416  __Pyx_GIVEREF(__pyx_tuple__4);
22417 
22418  /* "(tree fragment)":4
22419  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling")
22420  * def __setstate_cython__(self, __pyx_state):
22421  * raise TypeError("self.A,self.AC,self.L,self.U,self.X,self.etree,self.perm_c,self.perm_r,self.storeA,self.storeX cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
22422  */
22423  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self_A_self_AC_self_L_self_U_sel); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 4, __pyx_L1_error)
22424  __Pyx_GOTREF(__pyx_tuple__5);
22425  __Pyx_GIVEREF(__pyx_tuple__5);
22426 
22427  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
22428  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
22429  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
22430  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
22431  *
22432  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
22433  */
22434  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 272, __pyx_L1_error)
22435  __Pyx_GOTREF(__pyx_tuple__6);
22436  __Pyx_GIVEREF(__pyx_tuple__6);
22437 
22438  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
22439  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
22440  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
22441  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
22442  *
22443  * info.buf = PyArray_DATA(self)
22444  */
22445  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 276, __pyx_L1_error)
22446  __Pyx_GOTREF(__pyx_tuple__7);
22447  __Pyx_GIVEREF(__pyx_tuple__7);
22448 
22449  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
22450  * if ((descr.byteorder == c'>' and little_endian) or
22451  * (descr.byteorder == c'<' and not little_endian)):
22452  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
22453  * if t == NPY_BYTE: f = "b"
22454  * elif t == NPY_UBYTE: f = "B"
22455  */
22456  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 306, __pyx_L1_error)
22457  __Pyx_GOTREF(__pyx_tuple__8);
22458  __Pyx_GIVEREF(__pyx_tuple__8);
22459 
22460  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
22461  *
22462  * if (end - f) - <int>(new_offset - offset[0]) < 15:
22463  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
22464  *
22465  * if ((child.byteorder == c'>' and little_endian) or
22466  */
22467  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 856, __pyx_L1_error)
22468  __Pyx_GOTREF(__pyx_tuple__9);
22469  __Pyx_GIVEREF(__pyx_tuple__9);
22470 
22471  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":880
22472  * t = child.type_num
22473  * if end - f < 5:
22474  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
22475  *
22476  * # Until ticket #99 is fixed, use integers to avoid warnings
22477  */
22478  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 880, __pyx_L1_error)
22479  __Pyx_GOTREF(__pyx_tuple__10);
22480  __Pyx_GIVEREF(__pyx_tuple__10);
22481 
22482  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038
22483  * _import_array()
22484  * except Exception:
22485  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
22486  *
22487  * cdef inline int import_umath() except -1:
22488  */
22489  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 1038, __pyx_L1_error)
22490  __Pyx_GOTREF(__pyx_tuple__11);
22491  __Pyx_GIVEREF(__pyx_tuple__11);
22492 
22493  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044
22494  * _import_umath()
22495  * except Exception:
22496  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
22497  *
22498  * cdef inline int import_ufunc() except -1:
22499  */
22500  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 1044, __pyx_L1_error)
22501  __Pyx_GOTREF(__pyx_tuple__12);
22502  __Pyx_GIVEREF(__pyx_tuple__12);
22503 
22504  /* "View.MemoryView":133
22505  *
22506  * if not self.ndim:
22507  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
22508  *
22509  * if itemsize <= 0:
22510  */
22511  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 133, __pyx_L1_error)
22512  __Pyx_GOTREF(__pyx_tuple__13);
22513  __Pyx_GIVEREF(__pyx_tuple__13);
22514 
22515  /* "View.MemoryView":136
22516  *
22517  * if itemsize <= 0:
22518  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
22519  *
22520  * if not isinstance(format, bytes):
22521  */
22522  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 136, __pyx_L1_error)
22523  __Pyx_GOTREF(__pyx_tuple__14);
22524  __Pyx_GIVEREF(__pyx_tuple__14);
22525 
22526  /* "View.MemoryView":148
22527  *
22528  * if not self._shape:
22529  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
22530  *
22531  *
22532  */
22533  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 148, __pyx_L1_error)
22534  __Pyx_GOTREF(__pyx_tuple__15);
22535  __Pyx_GIVEREF(__pyx_tuple__15);
22536 
22537  /* "View.MemoryView":176
22538  * self.data = <char *>malloc(self.len)
22539  * if not self.data:
22540  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
22541  *
22542  * if self.dtype_is_object:
22543  */
22544  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 176, __pyx_L1_error)
22545  __Pyx_GOTREF(__pyx_tuple__16);
22546  __Pyx_GIVEREF(__pyx_tuple__16);
22547 
22548  /* "View.MemoryView":192
22549  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
22550  * if not (flags & bufmode):
22551  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
22552  * info.buf = self.data
22553  * info.len = self.len
22554  */
22555  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 192, __pyx_L1_error)
22556  __Pyx_GOTREF(__pyx_tuple__17);
22557  __Pyx_GIVEREF(__pyx_tuple__17);
22558 
22559  /* "(tree fragment)":2
22560  * def __reduce_cython__(self):
22561  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22562  * def __setstate_cython__(self, __pyx_state):
22563  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22564  */
22565  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 2, __pyx_L1_error)
22566  __Pyx_GOTREF(__pyx_tuple__18);
22567  __Pyx_GIVEREF(__pyx_tuple__18);
22568 
22569  /* "(tree fragment)":4
22570  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22571  * def __setstate_cython__(self, __pyx_state):
22572  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22573  */
22574  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 4, __pyx_L1_error)
22575  __Pyx_GOTREF(__pyx_tuple__19);
22576  __Pyx_GIVEREF(__pyx_tuple__19);
22577 
22578  /* "View.MemoryView":418
22579  * def __setitem__(memoryview self, object index, object value):
22580  * if self.view.readonly:
22581  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
22582  *
22583  * have_slices, index = _unellipsify(index, self.view.ndim)
22584  */
22585  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 418, __pyx_L1_error)
22586  __Pyx_GOTREF(__pyx_tuple__20);
22587  __Pyx_GIVEREF(__pyx_tuple__20);
22588 
22589  /* "View.MemoryView":495
22590  * result = struct.unpack(self.view.format, bytesitem)
22591  * except struct.error:
22592  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
22593  * else:
22594  * if len(self.view.format) == 1:
22595  */
22596  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 495, __pyx_L1_error)
22597  __Pyx_GOTREF(__pyx_tuple__21);
22598  __Pyx_GIVEREF(__pyx_tuple__21);
22599 
22600  /* "View.MemoryView":520
22601  * def __getbuffer__(self, Py_buffer *info, int flags):
22602  * if flags & PyBUF_WRITABLE and self.view.readonly:
22603  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
22604  *
22605  * if flags & PyBUF_ND:
22606  */
22607  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 520, __pyx_L1_error)
22608  __Pyx_GOTREF(__pyx_tuple__22);
22609  __Pyx_GIVEREF(__pyx_tuple__22);
22610 
22611  /* "View.MemoryView":570
22612  * if self.view.strides == NULL:
22613  *
22614  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
22615  *
22616  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
22617  */
22618  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 570, __pyx_L1_error)
22619  __Pyx_GOTREF(__pyx_tuple__23);
22620  __Pyx_GIVEREF(__pyx_tuple__23);
22621 
22622  /* "View.MemoryView":577
22623  * def suboffsets(self):
22624  * if self.view.suboffsets == NULL:
22625  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
22626  *
22627  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
22628  */
22629  __pyx_tuple__24 = PyTuple_New(1); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 577, __pyx_L1_error)
22630  __Pyx_GOTREF(__pyx_tuple__24);
22631  __Pyx_INCREF(__pyx_int_neg_1);
22632  __Pyx_GIVEREF(__pyx_int_neg_1);
22633  PyTuple_SET_ITEM(__pyx_tuple__24, 0, __pyx_int_neg_1);
22634  __Pyx_GIVEREF(__pyx_tuple__24);
22635 
22636  /* "(tree fragment)":2
22637  * def __reduce_cython__(self):
22638  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22639  * def __setstate_cython__(self, __pyx_state):
22640  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22641  */
22642  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 2, __pyx_L1_error)
22643  __Pyx_GOTREF(__pyx_tuple__25);
22644  __Pyx_GIVEREF(__pyx_tuple__25);
22645 
22646  /* "(tree fragment)":4
22647  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22648  * def __setstate_cython__(self, __pyx_state):
22649  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22650  */
22651  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 4, __pyx_L1_error)
22652  __Pyx_GOTREF(__pyx_tuple__26);
22653  __Pyx_GIVEREF(__pyx_tuple__26);
22654 
22655  /* "View.MemoryView":682
22656  * if item is Ellipsis:
22657  * if not seen_ellipsis:
22658  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
22659  * seen_ellipsis = True
22660  * else:
22661  */
22662  __pyx_slice__27 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__27)) __PYX_ERR(1, 682, __pyx_L1_error)
22663  __Pyx_GOTREF(__pyx_slice__27);
22664  __Pyx_GIVEREF(__pyx_slice__27);
22665 
22666  /* "View.MemoryView":703
22667  * for suboffset in suboffsets[:ndim]:
22668  * if suboffset >= 0:
22669  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
22670  *
22671  *
22672  */
22673  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 703, __pyx_L1_error)
22674  __Pyx_GOTREF(__pyx_tuple__28);
22675  __Pyx_GIVEREF(__pyx_tuple__28);
22676 
22677  /* "(tree fragment)":2
22678  * def __reduce_cython__(self):
22679  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22680  * def __setstate_cython__(self, __pyx_state):
22681  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22682  */
22683  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 2, __pyx_L1_error)
22684  __Pyx_GOTREF(__pyx_tuple__29);
22685  __Pyx_GIVEREF(__pyx_tuple__29);
22686 
22687  /* "(tree fragment)":4
22688  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22689  * def __setstate_cython__(self, __pyx_state):
22690  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22691  */
22692  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 4, __pyx_L1_error)
22693  __Pyx_GOTREF(__pyx_tuple__30);
22694  __Pyx_GIVEREF(__pyx_tuple__30);
22695 
22696  /* "superluWrappers.pyx":13
22697  * from libc.stdlib cimport malloc
22698  *
22699  * class SparseMatrix(object): # <<<<<<<<<<<<<<
22700  *
22701  * def __init__(self,
22702  */
22703  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 13, __pyx_L1_error)
22704  __Pyx_GOTREF(__pyx_tuple__31);
22705  __Pyx_GIVEREF(__pyx_tuple__31);
22706 
22707  /* "superluWrappers.pyx":15
22708  * class SparseMatrix(object):
22709  *
22710  * def __init__(self, # <<<<<<<<<<<<<<
22711  * nr,
22712  * nc,
22713  */
22714  __pyx_tuple__32 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_nr, __pyx_n_s_nc, __pyx_n_s_nnz, __pyx_n_s_nzvals, __pyx_n_s_colind, __pyx_n_s_rowptr); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 15, __pyx_L1_error)
22715  __Pyx_GOTREF(__pyx_tuple__32);
22716  __Pyx_GIVEREF(__pyx_tuple__32);
22717  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_init, 15, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 15, __pyx_L1_error)
22718 
22719  /* "superluWrappers.pyx":35
22720  * self.rowptr)
22721  *
22722  * def matvec(self, x, y): # <<<<<<<<<<<<<<
22723  * """
22724  * Compute the sparse matrix-vector product y = Ax
22725  */
22726  __pyx_tuple__34 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 35, __pyx_L1_error)
22727  __Pyx_GOTREF(__pyx_tuple__34);
22728  __Pyx_GIVEREF(__pyx_tuple__34);
22729  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_matvec, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 35, __pyx_L1_error)
22730 
22731  /* "superluWrappers.pyx":46
22732  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
22733  *
22734  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
22735  * """ Write the sparse matrix to a file
22736  *
22737  */
22738  __pyx_tuple__36 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_base, __pyx_n_s_output_file, __pyx_n_s_i, __pyx_n_s_k); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 46, __pyx_L1_error)
22739  __Pyx_GOTREF(__pyx_tuple__36);
22740  __Pyx_GIVEREF(__pyx_tuple__36);
22741  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_fwrite, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 46, __pyx_L1_error)
22742 
22743  /* "superluWrappers.pyx":62
22744  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
22745  *
22746  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
22747  * """ Get the CSR representation of the sparse matrix.
22748  *
22749  */
22750  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 62, __pyx_L1_error)
22751  __Pyx_GOTREF(__pyx_tuple__38);
22752  __Pyx_GIVEREF(__pyx_tuple__38);
22753  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_getCSRrepresentation, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 62, __pyx_L1_error)
22754 
22755  /* "superluWrappers.pyx":72
22756  * return (self.rowptr, self.colind, self.nzvals)
22757  *
22758  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
22759  * range_start,
22760  * range_end):
22761  */
22762  __pyx_tuple__40 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_range_start, __pyx_n_s_range_end, __pyx_n_s_rows, __pyx_n_s_nnz, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nzvals); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 72, __pyx_L1_error)
22763  __Pyx_GOTREF(__pyx_tuple__40);
22764  __Pyx_GIVEREF(__pyx_tuple__40);
22765  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_getSubMatCSRrepresentation, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 72, __pyx_L1_error)
22766 
22767  /* "superluWrappers.pyx":219
22768  * self.X.Store = &self.storeX
22769  *
22770  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
22771  * sparseFactor):
22772  * """ Python wrapper for superlu Sparse Factor Prepare function.
22773  */
22774  __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_sparse_matrix, __pyx_n_s_sparseFactor); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 219, __pyx_L1_error)
22775  __Pyx_GOTREF(__pyx_tuple__42);
22776  __Pyx_GIVEREF(__pyx_tuple__42);
22777  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_sparseFactorPrepare, 219, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 219, __pyx_L1_error)
22778 
22779  /* "superluWrappers.pyx":286
22780  * &info)
22781  *
22782  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
22783  * x):
22784  * """ Sparse factor solve wrappers
22785  */
22786  __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_sparseFactor, __pyx_n_s_x); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 286, __pyx_L1_error)
22787  __Pyx_GOTREF(__pyx_tuple__44);
22788  __Pyx_GIVEREF(__pyx_tuple__44);
22789  __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_superluWrappers_pyx, __pyx_n_s_sparseFactorSolve, 286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 286, __pyx_L1_error)
22790 
22791  /* "View.MemoryView":286
22792  * return self.name
22793  *
22794  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
22795  * cdef strided = Enum("<strided and direct>") # default
22796  * cdef indirect = Enum("<strided and indirect>")
22797  */
22798  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 286, __pyx_L1_error)
22799  __Pyx_GOTREF(__pyx_tuple__46);
22800  __Pyx_GIVEREF(__pyx_tuple__46);
22801 
22802  /* "View.MemoryView":287
22803  *
22804  * cdef generic = Enum("<strided and direct or indirect>")
22805  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
22806  * cdef indirect = Enum("<strided and indirect>")
22807  *
22808  */
22809  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 287, __pyx_L1_error)
22810  __Pyx_GOTREF(__pyx_tuple__47);
22811  __Pyx_GIVEREF(__pyx_tuple__47);
22812 
22813  /* "View.MemoryView":288
22814  * cdef generic = Enum("<strided and direct or indirect>")
22815  * cdef strided = Enum("<strided and direct>") # default
22816  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
22817  *
22818  *
22819  */
22820  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 288, __pyx_L1_error)
22821  __Pyx_GOTREF(__pyx_tuple__48);
22822  __Pyx_GIVEREF(__pyx_tuple__48);
22823 
22824  /* "View.MemoryView":291
22825  *
22826  *
22827  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
22828  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
22829  *
22830  */
22831  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 291, __pyx_L1_error)
22832  __Pyx_GOTREF(__pyx_tuple__49);
22833  __Pyx_GIVEREF(__pyx_tuple__49);
22834 
22835  /* "View.MemoryView":292
22836  *
22837  * cdef contiguous = Enum("<contiguous and direct>")
22838  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
22839  *
22840  *
22841  */
22842  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 292, __pyx_L1_error)
22843  __Pyx_GOTREF(__pyx_tuple__50);
22844  __Pyx_GIVEREF(__pyx_tuple__50);
22845 
22846  /* "(tree fragment)":1
22847  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
22848  * cdef object __pyx_PickleError
22849  * cdef object __pyx_result
22850  */
22851  __pyx_tuple__51 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 1, __pyx_L1_error)
22852  __Pyx_GOTREF(__pyx_tuple__51);
22853  __Pyx_GIVEREF(__pyx_tuple__51);
22854  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(1, 1, __pyx_L1_error)
22855  __Pyx_RefNannyFinishContext();
22856  return 0;
22857  __pyx_L1_error:;
22858  __Pyx_RefNannyFinishContext();
22859  return -1;
22860 }
22861 
22862 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
22863  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
22864  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
22865  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22866  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
22867  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22868  return 0;
22869  __pyx_L1_error:;
22870  return -1;
22871 }
22872 
22873 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
22874 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
22875 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
22876 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
22877 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
22878 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
22879 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
22880 
22881 static int __Pyx_modinit_global_init_code(void) {
22882  __Pyx_RefNannyDeclarations
22883  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
22884  /*--- Global init code ---*/
22885  generic = Py_None; Py_INCREF(Py_None);
22886  strided = Py_None; Py_INCREF(Py_None);
22887  indirect = Py_None; Py_INCREF(Py_None);
22888  contiguous = Py_None; Py_INCREF(Py_None);
22889  indirect_contiguous = Py_None; Py_INCREF(Py_None);
22890  __Pyx_RefNannyFinishContext();
22891  return 0;
22892 }
22893 
22894 static int __Pyx_modinit_variable_export_code(void) {
22895  __Pyx_RefNannyDeclarations
22896  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
22897  /*--- Variable export code ---*/
22898  __Pyx_RefNannyFinishContext();
22899  return 0;
22900 }
22901 
22902 static int __Pyx_modinit_function_export_code(void) {
22903  __Pyx_RefNannyDeclarations
22904  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
22905  /*--- Function export code ---*/
22906  __Pyx_RefNannyFinishContext();
22907  return 0;
22908 }
22909 
22910 static int __Pyx_modinit_type_init_code(void) {
22911  __Pyx_RefNannyDeclarations
22912  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
22913  /*--- Type init code ---*/
22914  if (PyType_Ready(&__pyx_type_15superluWrappers_cSparseMatrix) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
22915  #if PY_VERSION_HEX < 0x030800B1
22916  __pyx_type_15superluWrappers_cSparseMatrix.tp_print = 0;
22917  #endif
22918  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_15superluWrappers_cSparseMatrix.tp_dictoffset && __pyx_type_15superluWrappers_cSparseMatrix.tp_getattro == PyObject_GenericGetAttr)) {
22919  __pyx_type_15superluWrappers_cSparseMatrix.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22920  }
22921  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cSparseMatrix_2, (PyObject *)&__pyx_type_15superluWrappers_cSparseMatrix) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
22922  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_15superluWrappers_cSparseMatrix) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
22923  __pyx_ptype_15superluWrappers_cSparseMatrix = &__pyx_type_15superluWrappers_cSparseMatrix;
22924  __pyx_vtabptr_15superluWrappers_SparseFactor = &__pyx_vtable_15superluWrappers_SparseFactor;
22925  __pyx_vtable_15superluWrappers_SparseFactor._set_mat_types = (PyObject *(*)(struct __pyx_obj_15superluWrappers_SparseFactor *))__pyx_f_15superluWrappers_12SparseFactor__set_mat_types;
22926  if (PyType_Ready(&__pyx_type_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
22927  #if PY_VERSION_HEX < 0x030800B1
22928  __pyx_type_15superluWrappers_SparseFactor.tp_print = 0;
22929  #endif
22930  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_15superluWrappers_SparseFactor.tp_dictoffset && __pyx_type_15superluWrappers_SparseFactor.tp_getattro == PyObject_GenericGetAttr)) {
22931  __pyx_type_15superluWrappers_SparseFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22932  }
22933  #if CYTHON_COMPILING_IN_CPYTHON
22934  {
22935  PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_15superluWrappers_SparseFactor, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 145, __pyx_L1_error)
22936  if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
22937  __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
22938  __pyx_wrapperbase_15superluWrappers_12SparseFactor___init__.doc = __pyx_doc_15superluWrappers_12SparseFactor___init__;
22939  ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_15superluWrappers_12SparseFactor___init__;
22940  }
22941  }
22942  #endif
22943  if (__Pyx_SetVtable(__pyx_type_15superluWrappers_SparseFactor.tp_dict, __pyx_vtabptr_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
22944  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SparseFactor, (PyObject *)&__pyx_type_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
22945  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_15superluWrappers_SparseFactor) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
22946  __pyx_ptype_15superluWrappers_SparseFactor = &__pyx_type_15superluWrappers_SparseFactor;
22947  __pyx_vtabptr_array = &__pyx_vtable_array;
22948  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
22949  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22950  #if PY_VERSION_HEX < 0x030800B1
22951  __pyx_type___pyx_array.tp_print = 0;
22952  #endif
22953  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22954  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22955  __pyx_array_type = &__pyx_type___pyx_array;
22956  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
22957  #if PY_VERSION_HEX < 0x030800B1
22958  __pyx_type___pyx_MemviewEnum.tp_print = 0;
22959  #endif
22960  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
22961  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22962  }
22963  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
22964  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
22965  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
22966  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
22967  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
22968  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
22969  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
22970  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
22971  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
22972  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
22973  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22974  #if PY_VERSION_HEX < 0x030800B1
22975  __pyx_type___pyx_memoryview.tp_print = 0;
22976  #endif
22977  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
22978  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22979  }
22980  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22981  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22982  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
22983  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
22984  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
22985  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
22986  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
22987  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
22988  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22989  #if PY_VERSION_HEX < 0x030800B1
22990  __pyx_type___pyx_memoryviewslice.tp_print = 0;
22991  #endif
22992  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
22993  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22994  }
22995  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22996  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22997  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
22998  __Pyx_RefNannyFinishContext();
22999  return 0;
23000  __pyx_L1_error:;
23001  __Pyx_RefNannyFinishContext();
23002  return -1;
23003 }
23004 
23005 static int __Pyx_modinit_type_import_code(void) {
23006  __Pyx_RefNannyDeclarations
23007  PyObject *__pyx_t_1 = NULL;
23008  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
23009  /*--- Type import code ---*/
23010  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
23011  __Pyx_GOTREF(__pyx_t_1);
23012  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
23013  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23014  sizeof(PyTypeObject),
23015  #else
23016  sizeof(PyHeapTypeObject),
23017  #endif
23018  __Pyx_ImportType_CheckSize_Warn);
23019  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
23020  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23021  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 206, __pyx_L1_error)
23022  __Pyx_GOTREF(__pyx_t_1);
23023  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
23024  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 206, __pyx_L1_error)
23025  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
23026  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 229, __pyx_L1_error)
23027  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
23028  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 233, __pyx_L1_error)
23029  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
23030  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 242, __pyx_L1_error)
23031  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
23032  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 918, __pyx_L1_error)
23033  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23034  __Pyx_RefNannyFinishContext();
23035  return 0;
23036  __pyx_L1_error:;
23037  __Pyx_XDECREF(__pyx_t_1);
23038  __Pyx_RefNannyFinishContext();
23039  return -1;
23040 }
23041 
23042 static int __Pyx_modinit_variable_import_code(void) {
23043  __Pyx_RefNannyDeclarations
23044  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
23045  /*--- Variable import code ---*/
23046  __Pyx_RefNannyFinishContext();
23047  return 0;
23048 }
23049 
23050 static int __Pyx_modinit_function_import_code(void) {
23051  __Pyx_RefNannyDeclarations
23052  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
23053  /*--- Function import code ---*/
23054  __Pyx_RefNannyFinishContext();
23055  return 0;
23056 }
23057 
23058 
23059 #if PY_MAJOR_VERSION < 3
23060 #ifdef CYTHON_NO_PYINIT_EXPORT
23061 #define __Pyx_PyMODINIT_FUNC void
23062 #else
23063 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23064 #endif
23065 #else
23066 #ifdef CYTHON_NO_PYINIT_EXPORT
23067 #define __Pyx_PyMODINIT_FUNC PyObject *
23068 #else
23069 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23070 #endif
23071 #endif
23072 
23073 
23074 #if PY_MAJOR_VERSION < 3
23075 __Pyx_PyMODINIT_FUNC initsuperluWrappers(void) CYTHON_SMALL_CODE; /*proto*/
23076 __Pyx_PyMODINIT_FUNC initsuperluWrappers(void)
23077 #else
23078 __Pyx_PyMODINIT_FUNC PyInit_superluWrappers(void) CYTHON_SMALL_CODE; /*proto*/
23079 __Pyx_PyMODINIT_FUNC PyInit_superluWrappers(void)
23080 #if CYTHON_PEP489_MULTI_PHASE_INIT
23081 {
23082  return PyModuleDef_Init(&__pyx_moduledef);
23083 }
23084 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
23085  #if PY_VERSION_HEX >= 0x030700A1
23086  static PY_INT64_T main_interpreter_id = -1;
23087  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
23088  if (main_interpreter_id == -1) {
23089  main_interpreter_id = current_id;
23090  return (unlikely(current_id == -1)) ? -1 : 0;
23091  } else if (unlikely(main_interpreter_id != current_id))
23092  #else
23093  static PyInterpreterState *main_interpreter = NULL;
23094  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
23095  if (!main_interpreter) {
23096  main_interpreter = current_interpreter;
23097  } else if (unlikely(main_interpreter != current_interpreter))
23098  #endif
23099  {
23100  PyErr_SetString(
23101  PyExc_ImportError,
23102  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
23103  return -1;
23104  }
23105  return 0;
23106 }
23107 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
23108  PyObject *value = PyObject_GetAttrString(spec, from_name);
23109  int result = 0;
23110  if (likely(value)) {
23111  if (allow_none || value != Py_None) {
23112  result = PyDict_SetItemString(moddict, to_name, value);
23113  }
23114  Py_DECREF(value);
23115  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23116  PyErr_Clear();
23117  } else {
23118  result = -1;
23119  }
23120  return result;
23121 }
23122 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23123  PyObject *module = NULL, *moddict, *modname;
23124  if (__Pyx_check_single_interpreter())
23125  return NULL;
23126  if (__pyx_m)
23127  return __Pyx_NewRef(__pyx_m);
23128  modname = PyObject_GetAttrString(spec, "name");
23129  if (unlikely(!modname)) goto bad;
23130  module = PyModule_NewObject(modname);
23131  Py_DECREF(modname);
23132  if (unlikely(!module)) goto bad;
23133  moddict = PyModule_GetDict(module);
23134  if (unlikely(!moddict)) goto bad;
23135  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
23136  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
23137  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
23138  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
23139  return module;
23140 bad:
23141  Py_XDECREF(module);
23142  return NULL;
23143 }
23144 
23145 
23146 static CYTHON_SMALL_CODE int __pyx_pymod_exec_superluWrappers(PyObject *__pyx_pyinit_module)
23147 #endif
23148 #endif
23149 {
23150  PyObject *__pyx_t_1 = NULL;
23151  PyObject *__pyx_t_2 = NULL;
23152  PyObject *__pyx_t_3 = NULL;
23153  static PyThread_type_lock __pyx_t_4[8];
23154  __Pyx_RefNannyDeclarations
23155  #if CYTHON_PEP489_MULTI_PHASE_INIT
23156  if (__pyx_m) {
23157  if (__pyx_m == __pyx_pyinit_module) return 0;
23158  PyErr_SetString(PyExc_RuntimeError, "Module 'superluWrappers' has already been imported. Re-initialisation is not supported.");
23159  return -1;
23160  }
23161  #elif PY_MAJOR_VERSION >= 3
23162  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
23163  #endif
23164  #if CYTHON_REFNANNY
23165 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
23166 if (!__Pyx_RefNanny) {
23167  PyErr_Clear();
23168  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
23169  if (!__Pyx_RefNanny)
23170  Py_FatalError("failed to import 'refnanny' module");
23171 }
23172 #endif
23173  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_superluWrappers(void)", 0);
23174  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23175  #ifdef __Pxy_PyFrame_Initialize_Offsets
23176  __Pxy_PyFrame_Initialize_Offsets();
23177  #endif
23178  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23179  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23180  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23181  #ifdef __Pyx_CyFunction_USED
23182  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23183  #endif
23184  #ifdef __Pyx_FusedFunction_USED
23185  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23186  #endif
23187  #ifdef __Pyx_Coroutine_USED
23188  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23189  #endif
23190  #ifdef __Pyx_Generator_USED
23191  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23192  #endif
23193  #ifdef __Pyx_AsyncGen_USED
23194  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23195  #endif
23196  #ifdef __Pyx_StopAsyncIteration_USED
23197  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23198  #endif
23199  /*--- Library function declarations ---*/
23200  /*--- Threads initialization code ---*/
23201  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23202  #ifdef WITH_THREAD /* Python build with threading support? */
23203  PyEval_InitThreads();
23204  #endif
23205  #endif
23206  /*--- Module creation code ---*/
23207  #if CYTHON_PEP489_MULTI_PHASE_INIT
23208  __pyx_m = __pyx_pyinit_module;
23209  Py_INCREF(__pyx_m);
23210  #else
23211  #if PY_MAJOR_VERSION < 3
23212  __pyx_m = Py_InitModule4("superluWrappers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23213  #else
23214  __pyx_m = PyModule_Create(&__pyx_moduledef);
23215  #endif
23216  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23217  #endif
23218  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23219  Py_INCREF(__pyx_d);
23220  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23221  Py_INCREF(__pyx_b);
23222  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23223  Py_INCREF(__pyx_cython_runtime);
23224  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23225  /*--- Initialize various global constants etc. ---*/
23226  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23227  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23228  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23229  #endif
23230  if (__pyx_module_is_main_superluWrappers) {
23231  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23232  }
23233  #if PY_MAJOR_VERSION >= 3
23234  {
23235  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23236  if (!PyDict_GetItemString(modules, "superluWrappers")) {
23237  if (unlikely(PyDict_SetItemString(modules, "superluWrappers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23238  }
23239  }
23240  #endif
23241  /*--- Builtin init code ---*/
23242  if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
23243  /*--- Constants init code ---*/
23244  if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
23245  /*--- Global type/function init code ---*/
23246  (void)__Pyx_modinit_global_init_code();
23247  (void)__Pyx_modinit_variable_export_code();
23248  (void)__Pyx_modinit_function_export_code();
23249  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
23250  if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
23251  (void)__Pyx_modinit_variable_import_code();
23252  (void)__Pyx_modinit_function_import_code();
23253  /*--- Execution code ---*/
23254  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23255  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23256  #endif
23257 
23258  /* "superluWrappers.pyx":7
23259  * # correctly. perhaps they should only be enabled when not in debug mode?
23260  *
23261  * import numpy as np # <<<<<<<<<<<<<<
23262  * import cython
23263  * cimport numpy as np
23264  */
23265  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
23266  __Pyx_GOTREF(__pyx_t_1);
23267  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
23268  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23269 
23270  /* "superluWrappers.pyx":13
23271  * from libc.stdlib cimport malloc
23272  *
23273  * class SparseMatrix(object): # <<<<<<<<<<<<<<
23274  *
23275  * def __init__(self,
23276  */
23277  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__31); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
23278  __Pyx_GOTREF(__pyx_t_1);
23279  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__31, __pyx_n_s_SparseMatrix, __pyx_n_s_SparseMatrix, (PyObject *) NULL, __pyx_n_s_superluWrappers, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
23280  __Pyx_GOTREF(__pyx_t_2);
23281 
23282  /* "superluWrappers.pyx":15
23283  * class SparseMatrix(object):
23284  *
23285  * def __init__(self, # <<<<<<<<<<<<<<
23286  * nr,
23287  * nc,
23288  */
23289  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_15superluWrappers_12SparseMatrix_1__init__, 0, __pyx_n_s_SparseMatrix___init, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error)
23290  __Pyx_GOTREF(__pyx_t_3);
23291  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
23292  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23293 
23294  /* "superluWrappers.pyx":35
23295  * self.rowptr)
23296  *
23297  * def matvec(self, x, y): # <<<<<<<<<<<<<<
23298  * """
23299  * Compute the sparse matrix-vector product y = Ax
23300  */
23301  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_15superluWrappers_12SparseMatrix_3matvec, 0, __pyx_n_s_SparseMatrix_matvec, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error)
23302  __Pyx_GOTREF(__pyx_t_3);
23303  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_matvec, __pyx_t_3) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
23304  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23305 
23306  /* "superluWrappers.pyx":46
23307  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
23308  *
23309  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
23310  * """ Write the sparse matrix to a file
23311  *
23312  */
23313  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_15superluWrappers_12SparseMatrix_5fwrite, 0, __pyx_n_s_SparseMatrix_fwrite, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error)
23314  __Pyx_GOTREF(__pyx_t_3);
23315  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_fwrite, __pyx_t_3) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
23316  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23317 
23318  /* "superluWrappers.pyx":62
23319  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
23320  *
23321  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
23322  * """ Get the CSR representation of the sparse matrix.
23323  *
23324  */
23325  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_15superluWrappers_12SparseMatrix_7getCSRrepresentation, 0, __pyx_n_s_SparseMatrix_getCSRrepresentatio, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
23326  __Pyx_GOTREF(__pyx_t_3);
23327  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getCSRrepresentation, __pyx_t_3) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
23328  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23329 
23330  /* "superluWrappers.pyx":72
23331  * return (self.rowptr, self.colind, self.nzvals)
23332  *
23333  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
23334  * range_start,
23335  * range_end):
23336  */
23337  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation, 0, __pyx_n_s_SparseMatrix_getSubMatCSRreprese, NULL, __pyx_n_s_superluWrappers, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
23338  __Pyx_GOTREF(__pyx_t_3);
23339  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getSubMatCSRrepresentation, __pyx_t_3) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
23340  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23341 
23342  /* "superluWrappers.pyx":13
23343  * from libc.stdlib cimport malloc
23344  *
23345  * class SparseMatrix(object): # <<<<<<<<<<<<<<
23346  *
23347  * def __init__(self,
23348  */
23349  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SparseMatrix, __pyx_tuple__31, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error)
23350  __Pyx_GOTREF(__pyx_t_3);
23351  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SparseMatrix, __pyx_t_3) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
23352  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23353  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23354  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23355 
23356  /* "superluWrappers.pyx":219
23357  * self.X.Store = &self.storeX
23358  *
23359  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
23360  * sparseFactor):
23361  * """ Python wrapper for superlu Sparse Factor Prepare function.
23362  */
23363  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15superluWrappers_1sparseFactorPrepare, NULL, __pyx_n_s_superluWrappers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
23364  __Pyx_GOTREF(__pyx_t_1);
23365  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparseFactorPrepare, __pyx_t_1) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
23366  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23367 
23368  /* "superluWrappers.pyx":286
23369  * &info)
23370  *
23371  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
23372  * x):
23373  * """ Sparse factor solve wrappers
23374  */
23375  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15superluWrappers_3sparseFactorSolve, NULL, __pyx_n_s_superluWrappers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
23376  __Pyx_GOTREF(__pyx_t_1);
23377  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sparseFactorSolve, __pyx_t_1) < 0) __PYX_ERR(0, 286, __pyx_L1_error)
23378  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23379 
23380  /* "superluWrappers.pyx":1
23381  * #cython: boundscheck=False, wraparound=False, nonecheck=False, initializedcheck=False # <<<<<<<<<<<<<<
23382  *
23383  * # ARB - the cython directives above allow code to run much faster. it is worth noting
23384  */
23385  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23386  __Pyx_GOTREF(__pyx_t_1);
23387  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23388  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23389 
23390  /* "View.MemoryView":209
23391  * info.obj = self
23392  *
23393  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23394  *
23395  * def __dealloc__(array self):
23396  */
23397  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
23398  __Pyx_GOTREF(__pyx_t_1);
23399  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
23400  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23401  PyType_Modified(__pyx_array_type);
23402 
23403  /* "View.MemoryView":286
23404  * return self.name
23405  *
23406  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23407  * cdef strided = Enum("<strided and direct>") # default
23408  * cdef indirect = Enum("<strided and indirect>")
23409  */
23410  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
23411  __Pyx_GOTREF(__pyx_t_1);
23412  __Pyx_XGOTREF(generic);
23413  __Pyx_DECREF_SET(generic, __pyx_t_1);
23414  __Pyx_GIVEREF(__pyx_t_1);
23415  __pyx_t_1 = 0;
23416 
23417  /* "View.MemoryView":287
23418  *
23419  * cdef generic = Enum("<strided and direct or indirect>")
23420  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23421  * cdef indirect = Enum("<strided and indirect>")
23422  *
23423  */
23424  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
23425  __Pyx_GOTREF(__pyx_t_1);
23426  __Pyx_XGOTREF(strided);
23427  __Pyx_DECREF_SET(strided, __pyx_t_1);
23428  __Pyx_GIVEREF(__pyx_t_1);
23429  __pyx_t_1 = 0;
23430 
23431  /* "View.MemoryView":288
23432  * cdef generic = Enum("<strided and direct or indirect>")
23433  * cdef strided = Enum("<strided and direct>") # default
23434  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23435  *
23436  *
23437  */
23438  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
23439  __Pyx_GOTREF(__pyx_t_1);
23440  __Pyx_XGOTREF(indirect);
23441  __Pyx_DECREF_SET(indirect, __pyx_t_1);
23442  __Pyx_GIVEREF(__pyx_t_1);
23443  __pyx_t_1 = 0;
23444 
23445  /* "View.MemoryView":291
23446  *
23447  *
23448  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23449  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23450  *
23451  */
23452  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
23453  __Pyx_GOTREF(__pyx_t_1);
23454  __Pyx_XGOTREF(contiguous);
23455  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
23456  __Pyx_GIVEREF(__pyx_t_1);
23457  __pyx_t_1 = 0;
23458 
23459  /* "View.MemoryView":292
23460  *
23461  * cdef contiguous = Enum("<contiguous and direct>")
23462  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23463  *
23464  *
23465  */
23466  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
23467  __Pyx_GOTREF(__pyx_t_1);
23468  __Pyx_XGOTREF(indirect_contiguous);
23469  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
23470  __Pyx_GIVEREF(__pyx_t_1);
23471  __pyx_t_1 = 0;
23472 
23473  /* "View.MemoryView":316
23474  *
23475  * DEF THREAD_LOCKS_PREALLOCATED = 8
23476  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
23477  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
23478  * PyThread_allocate_lock(),
23479  */
23480  __pyx_memoryview_thread_locks_used = 0;
23481 
23482  /* "View.MemoryView":317
23483  * DEF THREAD_LOCKS_PREALLOCATED = 8
23484  * cdef int __pyx_memoryview_thread_locks_used = 0
23485  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
23486  * PyThread_allocate_lock(),
23487  * PyThread_allocate_lock(),
23488  */
23489  __pyx_t_4[0] = PyThread_allocate_lock();
23490  __pyx_t_4[1] = PyThread_allocate_lock();
23491  __pyx_t_4[2] = PyThread_allocate_lock();
23492  __pyx_t_4[3] = PyThread_allocate_lock();
23493  __pyx_t_4[4] = PyThread_allocate_lock();
23494  __pyx_t_4[5] = PyThread_allocate_lock();
23495  __pyx_t_4[6] = PyThread_allocate_lock();
23496  __pyx_t_4[7] = PyThread_allocate_lock();
23497  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_4, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23498 
23499  /* "View.MemoryView":549
23500  * info.obj = self
23501  *
23502  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23503  *
23504  *
23505  */
23506  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
23507  __Pyx_GOTREF(__pyx_t_1);
23508  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
23509  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23510  PyType_Modified(__pyx_memoryview_type);
23511 
23512  /* "View.MemoryView":995
23513  * return self.from_object
23514  *
23515  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23516  *
23517  *
23518  */
23519  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
23520  __Pyx_GOTREF(__pyx_t_1);
23521  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
23522  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23523  PyType_Modified(__pyx_memoryviewslice_type);
23524 
23525  /* "(tree fragment)":1
23526  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23527  * cdef object __pyx_PickleError
23528  * cdef object __pyx_result
23529  */
23530  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23531  __Pyx_GOTREF(__pyx_t_1);
23532  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23533  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23534 
23535  /* "(tree fragment)":11
23536  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
23537  * return __pyx_result
23538  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
23539  * __pyx_result.name = __pyx_state[0]
23540  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
23541  */
23542 
23543  /*--- Wrapped vars code ---*/
23544 
23545  goto __pyx_L0;
23546  __pyx_L1_error:;
23547  __Pyx_XDECREF(__pyx_t_1);
23548  __Pyx_XDECREF(__pyx_t_2);
23549  __Pyx_XDECREF(__pyx_t_3);
23550  if (__pyx_m) {
23551  if (__pyx_d) {
23552  __Pyx_AddTraceback("init superluWrappers", __pyx_clineno, __pyx_lineno, __pyx_filename);
23553  }
23554  Py_CLEAR(__pyx_m);
23555  } else if (!PyErr_Occurred()) {
23556  PyErr_SetString(PyExc_ImportError, "init superluWrappers");
23557  }
23558  __pyx_L0:;
23559  __Pyx_RefNannyFinishContext();
23560  #if CYTHON_PEP489_MULTI_PHASE_INIT
23561  return (__pyx_m != NULL) ? 0 : -1;
23562  #elif PY_MAJOR_VERSION >= 3
23563  return __pyx_m;
23564  #else
23565  return;
23566  #endif
23567 }
23568 
23569 /* --- Runtime support code --- */
23570 /* Refnanny */
23571 #if CYTHON_REFNANNY
23572 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
23573  PyObject *m = NULL, *p = NULL;
23574  void *r = NULL;
23575  m = PyImport_ImportModule(modname);
23576  if (!m) goto end;
23577  p = PyObject_GetAttrString(m, "RefNannyAPI");
23578  if (!p) goto end;
23579  r = PyLong_AsVoidPtr(p);
23580 end:
23581  Py_XDECREF(p);
23582  Py_XDECREF(m);
23583  return (__Pyx_RefNannyAPIStruct *)r;
23584 }
23585 #endif
23586 
23587 /* PyObjectGetAttrStr */
23588 #if CYTHON_USE_TYPE_SLOTS
23589 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23590  PyTypeObject* tp = Py_TYPE(obj);
23591  if (likely(tp->tp_getattro))
23592  return tp->tp_getattro(obj, attr_name);
23593 #if PY_MAJOR_VERSION < 3
23594  if (likely(tp->tp_getattr))
23595  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23596 #endif
23597  return PyObject_GetAttr(obj, attr_name);
23598 }
23599 #endif
23600 
23601 /* GetBuiltinName */
23602 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23603  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23604  if (unlikely(!result)) {
23605  PyErr_Format(PyExc_NameError,
23606 #if PY_MAJOR_VERSION >= 3
23607  "name '%U' is not defined", name);
23608 #else
23609  "name '%.200s' is not defined", PyString_AS_STRING(name));
23610 #endif
23611  }
23612  return result;
23613 }
23614 
23615 /* RaiseArgTupleInvalid */
23616 static void __Pyx_RaiseArgtupleInvalid(
23617  const char* func_name,
23618  int exact,
23619  Py_ssize_t num_min,
23620  Py_ssize_t num_max,
23621  Py_ssize_t num_found)
23622 {
23623  Py_ssize_t num_expected;
23624  const char *more_or_less;
23625  if (num_found < num_min) {
23626  num_expected = num_min;
23627  more_or_less = "at least";
23628  } else {
23629  num_expected = num_max;
23630  more_or_less = "at most";
23631  }
23632  if (exact) {
23633  more_or_less = "exactly";
23634  }
23635  PyErr_Format(PyExc_TypeError,
23636  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
23637  func_name, more_or_less, num_expected,
23638  (num_expected == 1) ? "" : "s", num_found);
23639 }
23640 
23641 /* RaiseDoubleKeywords */
23642 static void __Pyx_RaiseDoubleKeywordsError(
23643  const char* func_name,
23644  PyObject* kw_name)
23645 {
23646  PyErr_Format(PyExc_TypeError,
23647  #if PY_MAJOR_VERSION >= 3
23648  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23649  #else
23650  "%s() got multiple values for keyword argument '%s'", func_name,
23651  PyString_AsString(kw_name));
23652  #endif
23653 }
23654 
23655 /* ParseKeywords */
23656 static int __Pyx_ParseOptionalKeywords(
23657  PyObject *kwds,
23658  PyObject **argnames[],
23659  PyObject *kwds2,
23660  PyObject *values[],
23661  Py_ssize_t num_pos_args,
23662  const char* function_name)
23663 {
23664  PyObject *key = 0, *value = 0;
23665  Py_ssize_t pos = 0;
23666  PyObject*** name;
23667  PyObject*** first_kw_arg = argnames + num_pos_args;
23668  while (PyDict_Next(kwds, &pos, &key, &value)) {
23669  name = first_kw_arg;
23670  while (*name && (**name != key)) name++;
23671  if (*name) {
23672  values[name-argnames] = value;
23673  continue;
23674  }
23675  name = first_kw_arg;
23676  #if PY_MAJOR_VERSION < 3
23677  if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
23678  while (*name) {
23679  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23680  && _PyString_Eq(**name, key)) {
23681  values[name-argnames] = value;
23682  break;
23683  }
23684  name++;
23685  }
23686  if (*name) continue;
23687  else {
23688  PyObject*** argname = argnames;
23689  while (argname != first_kw_arg) {
23690  if ((**argname == key) || (
23691  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23692  && _PyString_Eq(**argname, key))) {
23693  goto arg_passed_twice;
23694  }
23695  argname++;
23696  }
23697  }
23698  } else
23699  #endif
23700  if (likely(PyUnicode_Check(key))) {
23701  while (*name) {
23702  int cmp = (**name == key) ? 0 :
23703  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23704  (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
23705  #endif
23706  PyUnicode_Compare(**name, key);
23707  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23708  if (cmp == 0) {
23709  values[name-argnames] = value;
23710  break;
23711  }
23712  name++;
23713  }
23714  if (*name) continue;
23715  else {
23716  PyObject*** argname = argnames;
23717  while (argname != first_kw_arg) {
23718  int cmp = (**argname == key) ? 0 :
23719  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23720  (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
23721  #endif
23722  PyUnicode_Compare(**argname, key);
23723  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23724  if (cmp == 0) goto arg_passed_twice;
23725  argname++;
23726  }
23727  }
23728  } else
23729  goto invalid_keyword_type;
23730  if (kwds2) {
23731  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
23732  } else {
23733  goto invalid_keyword;
23734  }
23735  }
23736  return 0;
23737 arg_passed_twice:
23738  __Pyx_RaiseDoubleKeywordsError(function_name, key);
23739  goto bad;
23740 invalid_keyword_type:
23741  PyErr_Format(PyExc_TypeError,
23742  "%.200s() keywords must be strings", function_name);
23743  goto bad;
23744 invalid_keyword:
23745  PyErr_Format(PyExc_TypeError,
23746  #if PY_MAJOR_VERSION < 3
23747  "%.200s() got an unexpected keyword argument '%.200s'",
23748  function_name, PyString_AsString(key));
23749  #else
23750  "%s() got an unexpected keyword argument '%U'",
23751  function_name, key);
23752  #endif
23753 bad:
23754  return -1;
23755 }
23756 
23757 /* PyObjectSetAttrStr */
23758 #if CYTHON_USE_TYPE_SLOTS
23759 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
23760  PyTypeObject* tp = Py_TYPE(obj);
23761  if (likely(tp->tp_setattro))
23762  return tp->tp_setattro(obj, attr_name, value);
23763 #if PY_MAJOR_VERSION < 3
23764  if (likely(tp->tp_setattr))
23765  return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
23766 #endif
23767  return PyObject_SetAttr(obj, attr_name, value);
23768 }
23769 #endif
23770 
23771 /* PyObjectCall */
23772 #if CYTHON_COMPILING_IN_CPYTHON
23773 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
23774  PyObject *result;
23775  ternaryfunc call = func->ob_type->tp_call;
23776  if (unlikely(!call))
23777  return PyObject_Call(func, arg, kw);
23778  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
23779  return NULL;
23780  result = (*call)(func, arg, kw);
23781  Py_LeaveRecursiveCall();
23782  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23783  PyErr_SetString(
23784  PyExc_SystemError,
23785  "NULL result without error in PyObject_Call");
23786  }
23787  return result;
23788 }
23789 #endif
23790 
23791 /* ExtTypeTest */
23792 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
23793  if (unlikely(!type)) {
23794  PyErr_SetString(PyExc_SystemError, "Missing type object");
23795  return 0;
23796  }
23797  if (likely(__Pyx_TypeCheck(obj, type)))
23798  return 1;
23799  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
23800  Py_TYPE(obj)->tp_name, type->tp_name);
23801  return 0;
23802 }
23803 
23804 /* MemviewSliceInit */
23805 static int
23806 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
23807  int ndim,
23808  __Pyx_memviewslice *memviewslice,
23809  int memview_is_new_reference)
23810 {
23811  __Pyx_RefNannyDeclarations
23812  int i, retval=-1;
23813  Py_buffer *buf = &memview->view;
23814  __Pyx_RefNannySetupContext("init_memviewslice", 0);
23815  if (memviewslice->memview || memviewslice->data) {
23816  PyErr_SetString(PyExc_ValueError,
23817  "memviewslice is already initialized!");
23818  goto fail;
23819  }
23820  if (buf->strides) {
23821  for (i = 0; i < ndim; i++) {
23822  memviewslice->strides[i] = buf->strides[i];
23823  }
23824  } else {
23825  Py_ssize_t stride = buf->itemsize;
23826  for (i = ndim - 1; i >= 0; i--) {
23827  memviewslice->strides[i] = stride;
23828  stride *= buf->shape[i];
23829  }
23830  }
23831  for (i = 0; i < ndim; i++) {
23832  memviewslice->shape[i] = buf->shape[i];
23833  if (buf->suboffsets) {
23834  memviewslice->suboffsets[i] = buf->suboffsets[i];
23835  } else {
23836  memviewslice->suboffsets[i] = -1;
23837  }
23838  }
23839  memviewslice->memview = memview;
23840  memviewslice->data = (char *)buf->buf;
23841  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
23842  Py_INCREF(memview);
23843  }
23844  retval = 0;
23845  goto no_fail;
23846 fail:
23847  memviewslice->memview = 0;
23848  memviewslice->data = 0;
23849  retval = -1;
23850 no_fail:
23851  __Pyx_RefNannyFinishContext();
23852  return retval;
23853 }
23854 #ifndef Py_NO_RETURN
23855 #define Py_NO_RETURN
23856 #endif
23857 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
23858  va_list vargs;
23859  char msg[200];
23860 #ifdef HAVE_STDARG_PROTOTYPES
23861  va_start(vargs, fmt);
23862 #else
23863  va_start(vargs);
23864 #endif
23865  vsnprintf(msg, 200, fmt, vargs);
23866  va_end(vargs);
23867  Py_FatalError(msg);
23868 }
23869 static CYTHON_INLINE int
23870 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
23871  PyThread_type_lock lock)
23872 {
23873  int result;
23874  PyThread_acquire_lock(lock, 1);
23875  result = (*acquisition_count)++;
23876  PyThread_release_lock(lock);
23877  return result;
23878 }
23879 static CYTHON_INLINE int
23880 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
23881  PyThread_type_lock lock)
23882 {
23883  int result;
23884  PyThread_acquire_lock(lock, 1);
23885  result = (*acquisition_count)--;
23886  PyThread_release_lock(lock);
23887  return result;
23888 }
23889 static CYTHON_INLINE void
23890 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
23891 {
23892  int first_time;
23893  struct __pyx_memoryview_obj *memview = memslice->memview;
23894  if (!memview || (PyObject *) memview == Py_None)
23895  return;
23896  if (__pyx_get_slice_count(memview) < 0)
23897  __pyx_fatalerror("Acquisition count is %d (line %d)",
23898  __pyx_get_slice_count(memview), lineno);
23899  first_time = __pyx_add_acquisition_count(memview) == 0;
23900  if (first_time) {
23901  if (have_gil) {
23902  Py_INCREF((PyObject *) memview);
23903  } else {
23904  PyGILState_STATE _gilstate = PyGILState_Ensure();
23905  Py_INCREF((PyObject *) memview);
23906  PyGILState_Release(_gilstate);
23907  }
23908  }
23909 }
23910 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
23911  int have_gil, int lineno) {
23912  int last_time;
23913  struct __pyx_memoryview_obj *memview = memslice->memview;
23914  if (!memview ) {
23915  return;
23916  } else if ((PyObject *) memview == Py_None) {
23917  memslice->memview = NULL;
23918  return;
23919  }
23920  if (__pyx_get_slice_count(memview) <= 0)
23921  __pyx_fatalerror("Acquisition count is %d (line %d)",
23922  __pyx_get_slice_count(memview), lineno);
23923  last_time = __pyx_sub_acquisition_count(memview) == 1;
23924  memslice->data = NULL;
23925  if (last_time) {
23926  if (have_gil) {
23927  Py_CLEAR(memslice->memview);
23928  } else {
23929  PyGILState_STATE _gilstate = PyGILState_Ensure();
23930  Py_CLEAR(memslice->memview);
23931  PyGILState_Release(_gilstate);
23932  }
23933  } else {
23934  memslice->memview = NULL;
23935  }
23936 }
23937 
23938 /* PyFunctionFastCall */
23939 #if CYTHON_FAST_PYCALL
23940 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
23941  PyObject *globals) {
23942  PyFrameObject *f;
23943  PyThreadState *tstate = __Pyx_PyThreadState_Current;
23944  PyObject **fastlocals;
23945  Py_ssize_t i;
23946  PyObject *result;
23947  assert(globals != NULL);
23948  /* XXX Perhaps we should create a specialized
23949  PyFrame_New() that doesn't take locals, but does
23950  take builtins without sanity checking them.
23951  */
23952  assert(tstate != NULL);
23953  f = PyFrame_New(tstate, co, globals, NULL);
23954  if (f == NULL) {
23955  return NULL;
23956  }
23957  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
23958  for (i = 0; i < na; i++) {
23959  Py_INCREF(*args);
23960  fastlocals[i] = *args++;
23961  }
23962  result = PyEval_EvalFrameEx(f,0);
23963  ++tstate->recursion_depth;
23964  Py_DECREF(f);
23965  --tstate->recursion_depth;
23966  return result;
23967 }
23968 #if 1 || PY_VERSION_HEX < 0x030600B1
23969 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
23970  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
23971  PyObject *globals = PyFunction_GET_GLOBALS(func);
23972  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
23973  PyObject *closure;
23974 #if PY_MAJOR_VERSION >= 3
23975  PyObject *kwdefs;
23976 #endif
23977  PyObject *kwtuple, **k;
23978  PyObject **d;
23979  Py_ssize_t nd;
23980  Py_ssize_t nk;
23981  PyObject *result;
23982  assert(kwargs == NULL || PyDict_Check(kwargs));
23983  nk = kwargs ? PyDict_Size(kwargs) : 0;
23984  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
23985  return NULL;
23986  }
23987  if (
23988 #if PY_MAJOR_VERSION >= 3
23989  co->co_kwonlyargcount == 0 &&
23990 #endif
23991  likely(kwargs == NULL || nk == 0) &&
23992  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
23993  if (argdefs == NULL && co->co_argcount == nargs) {
23994  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
23995  goto done;
23996  }
23997  else if (nargs == 0 && argdefs != NULL
23998  && co->co_argcount == Py_SIZE(argdefs)) {
23999  /* function called with no arguments, but all parameters have
24000  a default value: use default values as arguments .*/
24001  args = &PyTuple_GET_ITEM(argdefs, 0);
24002  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24003  goto done;
24004  }
24005  }
24006  if (kwargs != NULL) {
24007  Py_ssize_t pos, i;
24008  kwtuple = PyTuple_New(2 * nk);
24009  if (kwtuple == NULL) {
24010  result = NULL;
24011  goto done;
24012  }
24013  k = &PyTuple_GET_ITEM(kwtuple, 0);
24014  pos = i = 0;
24015  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24016  Py_INCREF(k[i]);
24017  Py_INCREF(k[i+1]);
24018  i += 2;
24019  }
24020  nk = i / 2;
24021  }
24022  else {
24023  kwtuple = NULL;
24024  k = NULL;
24025  }
24026  closure = PyFunction_GET_CLOSURE(func);
24027 #if PY_MAJOR_VERSION >= 3
24028  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24029 #endif
24030  if (argdefs != NULL) {
24031  d = &PyTuple_GET_ITEM(argdefs, 0);
24032  nd = Py_SIZE(argdefs);
24033  }
24034  else {
24035  d = NULL;
24036  nd = 0;
24037  }
24038 #if PY_MAJOR_VERSION >= 3
24039  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24040  args, (int)nargs,
24041  k, (int)nk,
24042  d, (int)nd, kwdefs, closure);
24043 #else
24044  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24045  args, (int)nargs,
24046  k, (int)nk,
24047  d, (int)nd, closure);
24048 #endif
24049  Py_XDECREF(kwtuple);
24050 done:
24051  Py_LeaveRecursiveCall();
24052  return result;
24053 }
24054 #endif
24055 #endif
24056 
24057 /* PyObjectCallMethO */
24058 #if CYTHON_COMPILING_IN_CPYTHON
24059 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24060  PyObject *self, *result;
24061  PyCFunction cfunc;
24062  cfunc = PyCFunction_GET_FUNCTION(func);
24063  self = PyCFunction_GET_SELF(func);
24064  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24065  return NULL;
24066  result = cfunc(self, arg);
24067  Py_LeaveRecursiveCall();
24068  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24069  PyErr_SetString(
24070  PyExc_SystemError,
24071  "NULL result without error in PyObject_Call");
24072  }
24073  return result;
24074 }
24075 #endif
24076 
24077 /* PyObjectCallNoArg */
24078 #if CYTHON_COMPILING_IN_CPYTHON
24079 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24080 #if CYTHON_FAST_PYCALL
24081  if (PyFunction_Check(func)) {
24082  return __Pyx_PyFunction_FastCall(func, NULL, 0);
24083  }
24084 #endif
24085 #ifdef __Pyx_CyFunction_USED
24086  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
24087 #else
24088  if (likely(PyCFunction_Check(func)))
24089 #endif
24090  {
24091  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24092  return __Pyx_PyObject_CallMethO(func, NULL);
24093  }
24094  }
24095  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24096 }
24097 #endif
24098 
24099 /* PyCFunctionFastCall */
24100 #if CYTHON_FAST_PYCCALL
24101 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24102  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24103  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24104  PyObject *self = PyCFunction_GET_SELF(func);
24105  int flags = PyCFunction_GET_FLAGS(func);
24106  assert(PyCFunction_Check(func));
24107  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24108  assert(nargs >= 0);
24109  assert(nargs == 0 || args != NULL);
24110  /* _PyCFunction_FastCallDict() must not be called with an exception set,
24111  because it may clear it (directly or indirectly) and so the
24112  caller loses its exception */
24113  assert(!PyErr_Occurred());
24114  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24115  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
24116  } else {
24117  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
24118  }
24119 }
24120 #endif
24121 
24122 /* PyObjectCallOneArg */
24123 #if CYTHON_COMPILING_IN_CPYTHON
24124 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24125  PyObject *result;
24126  PyObject *args = PyTuple_New(1);
24127  if (unlikely(!args)) return NULL;
24128  Py_INCREF(arg);
24129  PyTuple_SET_ITEM(args, 0, arg);
24130  result = __Pyx_PyObject_Call(func, args, NULL);
24131  Py_DECREF(args);
24132  return result;
24133 }
24134 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24135 #if CYTHON_FAST_PYCALL
24136  if (PyFunction_Check(func)) {
24137  return __Pyx_PyFunction_FastCall(func, &arg, 1);
24138  }
24139 #endif
24140  if (likely(PyCFunction_Check(func))) {
24141  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24142  return __Pyx_PyObject_CallMethO(func, arg);
24143 #if CYTHON_FAST_PYCCALL
24144  } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
24145  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24146 #endif
24147  }
24148  }
24149  return __Pyx__PyObject_CallOneArg(func, arg);
24150 }
24151 #else
24152 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24153  PyObject *result;
24154  PyObject *args = PyTuple_Pack(1, arg);
24155  if (unlikely(!args)) return NULL;
24156  result = __Pyx_PyObject_Call(func, args, NULL);
24157  Py_DECREF(args);
24158  return result;
24159 }
24160 #endif
24161 
24162 /* GetItemInt */
24163 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24164  PyObject *r;
24165  if (!j) return NULL;
24166  r = PyObject_GetItem(o, j);
24167  Py_DECREF(j);
24168  return r;
24169 }
24170 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24171  CYTHON_NCP_UNUSED int wraparound,
24172  CYTHON_NCP_UNUSED int boundscheck) {
24173 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24174  Py_ssize_t wrapped_i = i;
24175  if (wraparound & unlikely(i < 0)) {
24176  wrapped_i += PyList_GET_SIZE(o);
24177  }
24178  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24179  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
24180  Py_INCREF(r);
24181  return r;
24182  }
24183  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24184 #else
24185  return PySequence_GetItem(o, i);
24186 #endif
24187 }
24188 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24189  CYTHON_NCP_UNUSED int wraparound,
24190  CYTHON_NCP_UNUSED int boundscheck) {
24191 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24192  Py_ssize_t wrapped_i = i;
24193  if (wraparound & unlikely(i < 0)) {
24194  wrapped_i += PyTuple_GET_SIZE(o);
24195  }
24196  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24197  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
24198  Py_INCREF(r);
24199  return r;
24200  }
24201  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24202 #else
24203  return PySequence_GetItem(o, i);
24204 #endif
24205 }
24206 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
24207  CYTHON_NCP_UNUSED int wraparound,
24208  CYTHON_NCP_UNUSED int boundscheck) {
24209 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24210  if (is_list || PyList_CheckExact(o)) {
24211  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24212  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
24213  PyObject *r = PyList_GET_ITEM(o, n);
24214  Py_INCREF(r);
24215  return r;
24216  }
24217  }
24218  else if (PyTuple_CheckExact(o)) {
24219  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24220  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
24221  PyObject *r = PyTuple_GET_ITEM(o, n);
24222  Py_INCREF(r);
24223  return r;
24224  }
24225  } else {
24226  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24227  if (likely(m && m->sq_item)) {
24228  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24229  Py_ssize_t l = m->sq_length(o);
24230  if (likely(l >= 0)) {
24231  i += l;
24232  } else {
24233  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24234  return NULL;
24235  PyErr_Clear();
24236  }
24237  }
24238  return m->sq_item(o, i);
24239  }
24240  }
24241 #else
24242  if (is_list || PySequence_Check(o)) {
24243  return PySequence_GetItem(o, i);
24244  }
24245 #endif
24246  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24247 }
24248 
24249 /* ObjectGetItem */
24250 #if CYTHON_USE_TYPE_SLOTS
24251 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24252  PyObject *runerr;
24253  Py_ssize_t key_value;
24254  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24255  if (unlikely(!(m && m->sq_item))) {
24256  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24257  return NULL;
24258  }
24259  key_value = __Pyx_PyIndex_AsSsize_t(index);
24260  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24261  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24262  }
24263  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24264  PyErr_Clear();
24265  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24266  }
24267  return NULL;
24268 }
24269 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24270  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24271  if (likely(m && m->mp_subscript)) {
24272  return m->mp_subscript(obj, key);
24273  }
24274  return __Pyx_PyObject_GetIndex(obj, key);
24275 }
24276 #endif
24277 
24278 /* PyObjectCall2Args */
24279 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
24280  PyObject *args, *result = NULL;
24281  #if CYTHON_FAST_PYCALL
24282  if (PyFunction_Check(function)) {
24283  PyObject *args[2] = {arg1, arg2};
24284  return __Pyx_PyFunction_FastCall(function, args, 2);
24285  }
24286  #endif
24287  #if CYTHON_FAST_PYCCALL
24288  if (__Pyx_PyFastCFunction_Check(function)) {
24289  PyObject *args[2] = {arg1, arg2};
24290  return __Pyx_PyCFunction_FastCall(function, args, 2);
24291  }
24292  #endif
24293  args = PyTuple_New(2);
24294  if (unlikely(!args)) goto done;
24295  Py_INCREF(arg1);
24296  PyTuple_SET_ITEM(args, 0, arg1);
24297  Py_INCREF(arg2);
24298  PyTuple_SET_ITEM(args, 1, arg2);
24299  Py_INCREF(function);
24300  result = __Pyx_PyObject_Call(function, args, NULL);
24301  Py_DECREF(args);
24302  Py_DECREF(function);
24303 done:
24304  return result;
24305 }
24306 
24307 /* PyIntBinop */
24308 #if !CYTHON_COMPILING_IN_PYPY
24309 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
24310  (void)inplace;
24311  (void)zerodivision_check;
24312  #if PY_MAJOR_VERSION < 3
24313  if (likely(PyInt_CheckExact(op1))) {
24314  const long b = intval;
24315  long x;
24316  long a = PyInt_AS_LONG(op1);
24317  x = (long)((unsigned long)a + b);
24318  if (likely((x^a) >= 0 || (x^b) >= 0))
24319  return PyInt_FromLong(x);
24320  return PyLong_Type.tp_as_number->nb_add(op1, op2);
24321  }
24322  #endif
24323  #if CYTHON_USE_PYLONG_INTERNALS
24324  if (likely(PyLong_CheckExact(op1))) {
24325  const long b = intval;
24326  long a, x;
24327 #ifdef HAVE_LONG_LONG
24328  const PY_LONG_LONG llb = intval;
24329  PY_LONG_LONG lla, llx;
24330 #endif
24331  const digit* digits = ((PyLongObject*)op1)->ob_digit;
24332  const Py_ssize_t size = Py_SIZE(op1);
24333  if (likely(__Pyx_sst_abs(size) <= 1)) {
24334  a = likely(size) ? digits[0] : 0;
24335  if (size == -1) a = -a;
24336  } else {
24337  switch (size) {
24338  case -2:
24339  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24340  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24341  break;
24342 #ifdef HAVE_LONG_LONG
24343  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24344  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24345  goto long_long;
24346 #endif
24347  }
24348  CYTHON_FALLTHROUGH;
24349  case 2:
24350  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24351  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24352  break;
24353 #ifdef HAVE_LONG_LONG
24354  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24355  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24356  goto long_long;
24357 #endif
24358  }
24359  CYTHON_FALLTHROUGH;
24360  case -3:
24361  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24362  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24363  break;
24364 #ifdef HAVE_LONG_LONG
24365  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24366  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24367  goto long_long;
24368 #endif
24369  }
24370  CYTHON_FALLTHROUGH;
24371  case 3:
24372  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24373  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24374  break;
24375 #ifdef HAVE_LONG_LONG
24376  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24377  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24378  goto long_long;
24379 #endif
24380  }
24381  CYTHON_FALLTHROUGH;
24382  case -4:
24383  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24384  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24385  break;
24386 #ifdef HAVE_LONG_LONG
24387  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24388  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24389  goto long_long;
24390 #endif
24391  }
24392  CYTHON_FALLTHROUGH;
24393  case 4:
24394  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24395  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24396  break;
24397 #ifdef HAVE_LONG_LONG
24398  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24399  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24400  goto long_long;
24401 #endif
24402  }
24403  CYTHON_FALLTHROUGH;
24404  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
24405  }
24406  }
24407  x = a + b;
24408  return PyLong_FromLong(x);
24409 #ifdef HAVE_LONG_LONG
24410  long_long:
24411  llx = lla + llb;
24412  return PyLong_FromLongLong(llx);
24413 #endif
24414 
24415 
24416  }
24417  #endif
24418  if (PyFloat_CheckExact(op1)) {
24419  const long b = intval;
24420  double a = PyFloat_AS_DOUBLE(op1);
24421  double result;
24422  PyFPE_START_PROTECT("add", return NULL)
24423  result = ((double)a) + (double)b;
24424  PyFPE_END_PROTECT(result)
24425  return PyFloat_FromDouble(result);
24426  }
24427  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
24428 }
24429 #endif
24430 
24431 /* GetTopmostException */
24432 #if CYTHON_USE_EXC_INFO_STACK
24433 static _PyErr_StackItem *
24434 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
24435 {
24436  _PyErr_StackItem *exc_info = tstate->exc_info;
24437  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
24438  exc_info->previous_item != NULL)
24439  {
24440  exc_info = exc_info->previous_item;
24441  }
24442  return exc_info;
24443 }
24444 #endif
24445 
24446 /* SaveResetException */
24447 #if CYTHON_FAST_THREAD_STATE
24448 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24449  #if CYTHON_USE_EXC_INFO_STACK
24450  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
24451  *type = exc_info->exc_type;
24452  *value = exc_info->exc_value;
24453  *tb = exc_info->exc_traceback;
24454  #else
24455  *type = tstate->exc_type;
24456  *value = tstate->exc_value;
24457  *tb = tstate->exc_traceback;
24458  #endif
24459  Py_XINCREF(*type);
24460  Py_XINCREF(*value);
24461  Py_XINCREF(*tb);
24462 }
24463 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24464  PyObject *tmp_type, *tmp_value, *tmp_tb;
24465  #if CYTHON_USE_EXC_INFO_STACK
24466  _PyErr_StackItem *exc_info = tstate->exc_info;
24467  tmp_type = exc_info->exc_type;
24468  tmp_value = exc_info->exc_value;
24469  tmp_tb = exc_info->exc_traceback;
24470  exc_info->exc_type = type;
24471  exc_info->exc_value = value;
24472  exc_info->exc_traceback = tb;
24473  #else
24474  tmp_type = tstate->exc_type;
24475  tmp_value = tstate->exc_value;
24476  tmp_tb = tstate->exc_traceback;
24477  tstate->exc_type = type;
24478  tstate->exc_value = value;
24479  tstate->exc_traceback = tb;
24480  #endif
24481  Py_XDECREF(tmp_type);
24482  Py_XDECREF(tmp_value);
24483  Py_XDECREF(tmp_tb);
24484 }
24485 #endif
24486 
24487 /* GetException */
24488 #if CYTHON_FAST_THREAD_STATE
24489 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
24490 #else
24491 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
24492 #endif
24493 {
24494  PyObject *local_type, *local_value, *local_tb;
24495 #if CYTHON_FAST_THREAD_STATE
24496  PyObject *tmp_type, *tmp_value, *tmp_tb;
24497  local_type = tstate->curexc_type;
24498  local_value = tstate->curexc_value;
24499  local_tb = tstate->curexc_traceback;
24500  tstate->curexc_type = 0;
24501  tstate->curexc_value = 0;
24502  tstate->curexc_traceback = 0;
24503 #else
24504  PyErr_Fetch(&local_type, &local_value, &local_tb);
24505 #endif
24506  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
24507 #if CYTHON_FAST_THREAD_STATE
24508  if (unlikely(tstate->curexc_type))
24509 #else
24510  if (unlikely(PyErr_Occurred()))
24511 #endif
24512  goto bad;
24513  #if PY_MAJOR_VERSION >= 3
24514  if (local_tb) {
24515  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
24516  goto bad;
24517  }
24518  #endif
24519  Py_XINCREF(local_tb);
24520  Py_XINCREF(local_type);
24521  Py_XINCREF(local_value);
24522  *type = local_type;
24523  *value = local_value;
24524  *tb = local_tb;
24525 #if CYTHON_FAST_THREAD_STATE
24526  #if CYTHON_USE_EXC_INFO_STACK
24527  {
24528  _PyErr_StackItem *exc_info = tstate->exc_info;
24529  tmp_type = exc_info->exc_type;
24530  tmp_value = exc_info->exc_value;
24531  tmp_tb = exc_info->exc_traceback;
24532  exc_info->exc_type = local_type;
24533  exc_info->exc_value = local_value;
24534  exc_info->exc_traceback = local_tb;
24535  }
24536  #else
24537  tmp_type = tstate->exc_type;
24538  tmp_value = tstate->exc_value;
24539  tmp_tb = tstate->exc_traceback;
24540  tstate->exc_type = local_type;
24541  tstate->exc_value = local_value;
24542  tstate->exc_traceback = local_tb;
24543  #endif
24544  Py_XDECREF(tmp_type);
24545  Py_XDECREF(tmp_value);
24546  Py_XDECREF(tmp_tb);
24547 #else
24548  PyErr_SetExcInfo(local_type, local_value, local_tb);
24549 #endif
24550  return 0;
24551 bad:
24552  *type = 0;
24553  *value = 0;
24554  *tb = 0;
24555  Py_XDECREF(local_type);
24556  Py_XDECREF(local_value);
24557  Py_XDECREF(local_tb);
24558  return -1;
24559 }
24560 
24561 /* PyErrFetchRestore */
24562 #if CYTHON_FAST_THREAD_STATE
24563 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24564  PyObject *tmp_type, *tmp_value, *tmp_tb;
24565  tmp_type = tstate->curexc_type;
24566  tmp_value = tstate->curexc_value;
24567  tmp_tb = tstate->curexc_traceback;
24568  tstate->curexc_type = type;
24569  tstate->curexc_value = value;
24570  tstate->curexc_traceback = tb;
24571  Py_XDECREF(tmp_type);
24572  Py_XDECREF(tmp_value);
24573  Py_XDECREF(tmp_tb);
24574 }
24575 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24576  *type = tstate->curexc_type;
24577  *value = tstate->curexc_value;
24578  *tb = tstate->curexc_traceback;
24579  tstate->curexc_type = 0;
24580  tstate->curexc_value = 0;
24581  tstate->curexc_traceback = 0;
24582 }
24583 #endif
24584 
24585 /* SliceObject */
24586 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
24587  Py_ssize_t cstart, Py_ssize_t cstop,
24588  PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
24589  int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
24590 #if CYTHON_USE_TYPE_SLOTS
24591  PyMappingMethods* mp;
24592 #if PY_MAJOR_VERSION < 3
24593  PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
24594  if (likely(ms && ms->sq_slice)) {
24595  if (!has_cstart) {
24596  if (_py_start && (*_py_start != Py_None)) {
24597  cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
24598  if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
24599  } else
24600  cstart = 0;
24601  }
24602  if (!has_cstop) {
24603  if (_py_stop && (*_py_stop != Py_None)) {
24604  cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
24605  if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
24606  } else
24607  cstop = PY_SSIZE_T_MAX;
24608  }
24609  if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
24610  Py_ssize_t l = ms->sq_length(obj);
24611  if (likely(l >= 0)) {
24612  if (cstop < 0) {
24613  cstop += l;
24614  if (cstop < 0) cstop = 0;
24615  }
24616  if (cstart < 0) {
24617  cstart += l;
24618  if (cstart < 0) cstart = 0;
24619  }
24620  } else {
24621  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24622  goto bad;
24623  PyErr_Clear();
24624  }
24625  }
24626  return ms->sq_slice(obj, cstart, cstop);
24627  }
24628 #endif
24629  mp = Py_TYPE(obj)->tp_as_mapping;
24630  if (likely(mp && mp->mp_subscript))
24631 #endif
24632  {
24633  PyObject* result;
24634  PyObject *py_slice, *py_start, *py_stop;
24635  if (_py_slice) {
24636  py_slice = *_py_slice;
24637  } else {
24638  PyObject* owned_start = NULL;
24639  PyObject* owned_stop = NULL;
24640  if (_py_start) {
24641  py_start = *_py_start;
24642  } else {
24643  if (has_cstart) {
24644  owned_start = py_start = PyInt_FromSsize_t(cstart);
24645  if (unlikely(!py_start)) goto bad;
24646  } else
24647  py_start = Py_None;
24648  }
24649  if (_py_stop) {
24650  py_stop = *_py_stop;
24651  } else {
24652  if (has_cstop) {
24653  owned_stop = py_stop = PyInt_FromSsize_t(cstop);
24654  if (unlikely(!py_stop)) {
24655  Py_XDECREF(owned_start);
24656  goto bad;
24657  }
24658  } else
24659  py_stop = Py_None;
24660  }
24661  py_slice = PySlice_New(py_start, py_stop, Py_None);
24662  Py_XDECREF(owned_start);
24663  Py_XDECREF(owned_stop);
24664  if (unlikely(!py_slice)) goto bad;
24665  }
24666 #if CYTHON_USE_TYPE_SLOTS
24667  result = mp->mp_subscript(obj, py_slice);
24668 #else
24669  result = PyObject_GetItem(obj, py_slice);
24670 #endif
24671  if (!_py_slice) {
24672  Py_DECREF(py_slice);
24673  }
24674  return result;
24675  }
24676  PyErr_Format(PyExc_TypeError,
24677  "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
24678 bad:
24679  return NULL;
24680 }
24681 
24682 /* RaiseException */
24683 #if PY_MAJOR_VERSION < 3
24684 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24685  CYTHON_UNUSED PyObject *cause) {
24686  __Pyx_PyThreadState_declare
24687  Py_XINCREF(type);
24688  if (!value || value == Py_None)
24689  value = NULL;
24690  else
24691  Py_INCREF(value);
24692  if (!tb || tb == Py_None)
24693  tb = NULL;
24694  else {
24695  Py_INCREF(tb);
24696  if (!PyTraceBack_Check(tb)) {
24697  PyErr_SetString(PyExc_TypeError,
24698  "raise: arg 3 must be a traceback or None");
24699  goto raise_error;
24700  }
24701  }
24702  if (PyType_Check(type)) {
24703 #if CYTHON_COMPILING_IN_PYPY
24704  if (!value) {
24705  Py_INCREF(Py_None);
24706  value = Py_None;
24707  }
24708 #endif
24709  PyErr_NormalizeException(&type, &value, &tb);
24710  } else {
24711  if (value) {
24712  PyErr_SetString(PyExc_TypeError,
24713  "instance exception may not have a separate value");
24714  goto raise_error;
24715  }
24716  value = type;
24717  type = (PyObject*) Py_TYPE(type);
24718  Py_INCREF(type);
24719  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24720  PyErr_SetString(PyExc_TypeError,
24721  "raise: exception class must be a subclass of BaseException");
24722  goto raise_error;
24723  }
24724  }
24725  __Pyx_PyThreadState_assign
24726  __Pyx_ErrRestore(type, value, tb);
24727  return;
24728 raise_error:
24729  Py_XDECREF(value);
24730  Py_XDECREF(type);
24731  Py_XDECREF(tb);
24732  return;
24733 }
24734 #else
24735 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
24736  PyObject* owned_instance = NULL;
24737  if (tb == Py_None) {
24738  tb = 0;
24739  } else if (tb && !PyTraceBack_Check(tb)) {
24740  PyErr_SetString(PyExc_TypeError,
24741  "raise: arg 3 must be a traceback or None");
24742  goto bad;
24743  }
24744  if (value == Py_None)
24745  value = 0;
24746  if (PyExceptionInstance_Check(type)) {
24747  if (value) {
24748  PyErr_SetString(PyExc_TypeError,
24749  "instance exception may not have a separate value");
24750  goto bad;
24751  }
24752  value = type;
24753  type = (PyObject*) Py_TYPE(value);
24754  } else if (PyExceptionClass_Check(type)) {
24755  PyObject *instance_class = NULL;
24756  if (value && PyExceptionInstance_Check(value)) {
24757  instance_class = (PyObject*) Py_TYPE(value);
24758  if (instance_class != type) {
24759  int is_subclass = PyObject_IsSubclass(instance_class, type);
24760  if (!is_subclass) {
24761  instance_class = NULL;
24762  } else if (unlikely(is_subclass == -1)) {
24763  goto bad;
24764  } else {
24765  type = instance_class;
24766  }
24767  }
24768  }
24769  if (!instance_class) {
24770  PyObject *args;
24771  if (!value)
24772  args = PyTuple_New(0);
24773  else if (PyTuple_Check(value)) {
24774  Py_INCREF(value);
24775  args = value;
24776  } else
24777  args = PyTuple_Pack(1, value);
24778  if (!args)
24779  goto bad;
24780  owned_instance = PyObject_Call(type, args, NULL);
24781  Py_DECREF(args);
24782  if (!owned_instance)
24783  goto bad;
24784  value = owned_instance;
24785  if (!PyExceptionInstance_Check(value)) {
24786  PyErr_Format(PyExc_TypeError,
24787  "calling %R should have returned an instance of "
24788  "BaseException, not %R",
24789  type, Py_TYPE(value));
24790  goto bad;
24791  }
24792  }
24793  } else {
24794  PyErr_SetString(PyExc_TypeError,
24795  "raise: exception class must be a subclass of BaseException");
24796  goto bad;
24797  }
24798  if (cause) {
24799  PyObject *fixed_cause;
24800  if (cause == Py_None) {
24801  fixed_cause = NULL;
24802  } else if (PyExceptionClass_Check(cause)) {
24803  fixed_cause = PyObject_CallObject(cause, NULL);
24804  if (fixed_cause == NULL)
24805  goto bad;
24806  } else if (PyExceptionInstance_Check(cause)) {
24807  fixed_cause = cause;
24808  Py_INCREF(fixed_cause);
24809  } else {
24810  PyErr_SetString(PyExc_TypeError,
24811  "exception causes must derive from "
24812  "BaseException");
24813  goto bad;
24814  }
24815  PyException_SetCause(value, fixed_cause);
24816  }
24817  PyErr_SetObject(type, value);
24818  if (tb) {
24819 #if CYTHON_COMPILING_IN_PYPY
24820  PyObject *tmp_type, *tmp_value, *tmp_tb;
24821  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24822  Py_INCREF(tb);
24823  PyErr_Restore(tmp_type, tmp_value, tb);
24824  Py_XDECREF(tmp_tb);
24825 #else
24826  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24827  PyObject* tmp_tb = tstate->curexc_traceback;
24828  if (tb != tmp_tb) {
24829  Py_INCREF(tb);
24830  tstate->curexc_traceback = tb;
24831  Py_XDECREF(tmp_tb);
24832  }
24833 #endif
24834  }
24835 bad:
24836  Py_XDECREF(owned_instance);
24837  return;
24838 }
24839 #endif
24840 
24841 /* WriteUnraisableException */
24842 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
24843  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
24844  int full_traceback, CYTHON_UNUSED int nogil) {
24845  PyObject *old_exc, *old_val, *old_tb;
24846  PyObject *ctx;
24847  __Pyx_PyThreadState_declare
24848 #ifdef WITH_THREAD
24849  PyGILState_STATE state;
24850  if (nogil)
24851  state = PyGILState_Ensure();
24852 #ifdef _MSC_VER
24853  else state = (PyGILState_STATE)-1;
24854 #endif
24855 #endif
24856  __Pyx_PyThreadState_assign
24857  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
24858  if (full_traceback) {
24859  Py_XINCREF(old_exc);
24860  Py_XINCREF(old_val);
24861  Py_XINCREF(old_tb);
24862  __Pyx_ErrRestore(old_exc, old_val, old_tb);
24863  PyErr_PrintEx(1);
24864  }
24865  #if PY_MAJOR_VERSION < 3
24866  ctx = PyString_FromString(name);
24867  #else
24868  ctx = PyUnicode_FromString(name);
24869  #endif
24870  __Pyx_ErrRestore(old_exc, old_val, old_tb);
24871  if (!ctx) {
24872  PyErr_WriteUnraisable(Py_None);
24873  } else {
24874  PyErr_WriteUnraisable(ctx);
24875  Py_DECREF(ctx);
24876  }
24877 #ifdef WITH_THREAD
24878  if (nogil)
24879  PyGILState_Release(state);
24880 #endif
24881 }
24882 
24883 /* DictGetItem */
24884 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
24885 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
24886  PyObject *value;
24887  value = PyDict_GetItemWithError(d, key);
24888  if (unlikely(!value)) {
24889  if (!PyErr_Occurred()) {
24890  if (unlikely(PyTuple_Check(key))) {
24891  PyObject* args = PyTuple_Pack(1, key);
24892  if (likely(args)) {
24893  PyErr_SetObject(PyExc_KeyError, args);
24894  Py_DECREF(args);
24895  }
24896  } else {
24897  PyErr_SetObject(PyExc_KeyError, key);
24898  }
24899  }
24900  return NULL;
24901  }
24902  Py_INCREF(value);
24903  return value;
24904 }
24905 #endif
24906 
24907 /* RaiseTooManyValuesToUnpack */
24908 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
24909  PyErr_Format(PyExc_ValueError,
24910  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
24911 }
24912 
24913 /* RaiseNeedMoreValuesToUnpack */
24914 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
24915  PyErr_Format(PyExc_ValueError,
24916  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
24917  index, (index == 1) ? "" : "s");
24918 }
24919 
24920 /* RaiseNoneIterError */
24921 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
24922  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
24923 }
24924 
24925 /* PyErrExceptionMatches */
24926 #if CYTHON_FAST_THREAD_STATE
24927 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24928  Py_ssize_t i, n;
24929  n = PyTuple_GET_SIZE(tuple);
24930 #if PY_MAJOR_VERSION >= 3
24931  for (i=0; i<n; i++) {
24932  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
24933  }
24934 #endif
24935  for (i=0; i<n; i++) {
24936  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
24937  }
24938  return 0;
24939 }
24940 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24941  PyObject *exc_type = tstate->curexc_type;
24942  if (exc_type == err) return 1;
24943  if (unlikely(!exc_type)) return 0;
24944  if (unlikely(PyTuple_Check(err)))
24945  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24946  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24947 }
24948 #endif
24949 
24950 /* ArgTypeTest */
24951 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
24952 {
24953  if (unlikely(!type)) {
24954  PyErr_SetString(PyExc_SystemError, "Missing type object");
24955  return 0;
24956  }
24957  else if (exact) {
24958  #if PY_MAJOR_VERSION == 2
24959  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
24960  #endif
24961  }
24962  else {
24963  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
24964  }
24965  PyErr_Format(PyExc_TypeError,
24966  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24967  name, type->tp_name, Py_TYPE(obj)->tp_name);
24968  return 0;
24969 }
24970 
24971 /* BytesEquals */
24972 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
24973 #if CYTHON_COMPILING_IN_PYPY
24974  return PyObject_RichCompareBool(s1, s2, equals);
24975 #else
24976  if (s1 == s2) {
24977  return (equals == Py_EQ);
24978  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
24979  const char *ps1, *ps2;
24980  Py_ssize_t length = PyBytes_GET_SIZE(s1);
24981  if (length != PyBytes_GET_SIZE(s2))
24982  return (equals == Py_NE);
24983  ps1 = PyBytes_AS_STRING(s1);
24984  ps2 = PyBytes_AS_STRING(s2);
24985  if (ps1[0] != ps2[0]) {
24986  return (equals == Py_NE);
24987  } else if (length == 1) {
24988  return (equals == Py_EQ);
24989  } else {
24990  int result;
24991 #if CYTHON_USE_UNICODE_INTERNALS
24992  Py_hash_t hash1, hash2;
24993  hash1 = ((PyBytesObject*)s1)->ob_shash;
24994  hash2 = ((PyBytesObject*)s2)->ob_shash;
24995  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24996  return (equals == Py_NE);
24997  }
24998 #endif
24999  result = memcmp(ps1, ps2, (size_t)length);
25000  return (equals == Py_EQ) ? (result == 0) : (result != 0);
25001  }
25002  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
25003  return (equals == Py_NE);
25004  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
25005  return (equals == Py_NE);
25006  } else {
25007  int result;
25008  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25009  if (!py_result)
25010  return -1;
25011  result = __Pyx_PyObject_IsTrue(py_result);
25012  Py_DECREF(py_result);
25013  return result;
25014  }
25015 #endif
25016 }
25017 
25018 /* UnicodeEquals */
25019 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
25020 #if CYTHON_COMPILING_IN_PYPY
25021  return PyObject_RichCompareBool(s1, s2, equals);
25022 #else
25023 #if PY_MAJOR_VERSION < 3
25024  PyObject* owned_ref = NULL;
25025 #endif
25026  int s1_is_unicode, s2_is_unicode;
25027  if (s1 == s2) {
25028  goto return_eq;
25029  }
25030  s1_is_unicode = PyUnicode_CheckExact(s1);
25031  s2_is_unicode = PyUnicode_CheckExact(s2);
25032 #if PY_MAJOR_VERSION < 3
25033  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
25034  owned_ref = PyUnicode_FromObject(s2);
25035  if (unlikely(!owned_ref))
25036  return -1;
25037  s2 = owned_ref;
25038  s2_is_unicode = 1;
25039  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
25040  owned_ref = PyUnicode_FromObject(s1);
25041  if (unlikely(!owned_ref))
25042  return -1;
25043  s1 = owned_ref;
25044  s1_is_unicode = 1;
25045  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
25046  return __Pyx_PyBytes_Equals(s1, s2, equals);
25047  }
25048 #endif
25049  if (s1_is_unicode & s2_is_unicode) {
25050  Py_ssize_t length;
25051  int kind;
25052  void *data1, *data2;
25053  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
25054  return -1;
25055  length = __Pyx_PyUnicode_GET_LENGTH(s1);
25056  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
25057  goto return_ne;
25058  }
25059 #if CYTHON_USE_UNICODE_INTERNALS
25060  {
25061  Py_hash_t hash1, hash2;
25062  #if CYTHON_PEP393_ENABLED
25063  hash1 = ((PyASCIIObject*)s1)->hash;
25064  hash2 = ((PyASCIIObject*)s2)->hash;
25065  #else
25066  hash1 = ((PyUnicodeObject*)s1)->hash;
25067  hash2 = ((PyUnicodeObject*)s2)->hash;
25068  #endif
25069  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25070  goto return_ne;
25071  }
25072  }
25073 #endif
25074  kind = __Pyx_PyUnicode_KIND(s1);
25075  if (kind != __Pyx_PyUnicode_KIND(s2)) {
25076  goto return_ne;
25077  }
25078  data1 = __Pyx_PyUnicode_DATA(s1);
25079  data2 = __Pyx_PyUnicode_DATA(s2);
25080  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
25081  goto return_ne;
25082  } else if (length == 1) {
25083  goto return_eq;
25084  } else {
25085  int result = memcmp(data1, data2, (size_t)(length * kind));
25086  #if PY_MAJOR_VERSION < 3
25087  Py_XDECREF(owned_ref);
25088  #endif
25089  return (equals == Py_EQ) ? (result == 0) : (result != 0);
25090  }
25091  } else if ((s1 == Py_None) & s2_is_unicode) {
25092  goto return_ne;
25093  } else if ((s2 == Py_None) & s1_is_unicode) {
25094  goto return_ne;
25095  } else {
25096  int result;
25097  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25098  #if PY_MAJOR_VERSION < 3
25099  Py_XDECREF(owned_ref);
25100  #endif
25101  if (!py_result)
25102  return -1;
25103  result = __Pyx_PyObject_IsTrue(py_result);
25104  Py_DECREF(py_result);
25105  return result;
25106  }
25107 return_eq:
25108  #if PY_MAJOR_VERSION < 3
25109  Py_XDECREF(owned_ref);
25110  #endif
25111  return (equals == Py_EQ);
25112 return_ne:
25113  #if PY_MAJOR_VERSION < 3
25114  Py_XDECREF(owned_ref);
25115  #endif
25116  return (equals == Py_NE);
25117 #endif
25118 }
25119 
25120 /* None */
25121 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
25122  Py_ssize_t q = a / b;
25123  Py_ssize_t r = a - q*b;
25124  q -= ((r != 0) & ((r ^ b) < 0));
25125  return q;
25126 }
25127 
25128 /* GetAttr */
25129 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
25130 #if CYTHON_USE_TYPE_SLOTS
25131 #if PY_MAJOR_VERSION >= 3
25132  if (likely(PyUnicode_Check(n)))
25133 #else
25134  if (likely(PyString_Check(n)))
25135 #endif
25136  return __Pyx_PyObject_GetAttrStr(o, n);
25137 #endif
25138  return PyObject_GetAttr(o, n);
25139 }
25140 
25141 /* decode_c_string */
25142 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
25143  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
25144  const char* encoding, const char* errors,
25145  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
25146  Py_ssize_t length;
25147  if (unlikely((start < 0) | (stop < 0))) {
25148  size_t slen = strlen(cstring);
25149  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
25150  PyErr_SetString(PyExc_OverflowError,
25151  "c-string too long to convert to Python");
25152  return NULL;
25153  }
25154  length = (Py_ssize_t) slen;
25155  if (start < 0) {
25156  start += length;
25157  if (start < 0)
25158  start = 0;
25159  }
25160  if (stop < 0)
25161  stop += length;
25162  }
25163  length = stop - start;
25164  if (unlikely(length <= 0))
25165  return PyUnicode_FromUnicode(NULL, 0);
25166  cstring += start;
25167  if (decode_func) {
25168  return decode_func(cstring, length, errors);
25169  } else {
25170  return PyUnicode_Decode(cstring, length, encoding, errors);
25171  }
25172 }
25173 
25174 /* GetAttr3 */
25175 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25176  __Pyx_PyThreadState_declare
25177  __Pyx_PyThreadState_assign
25178  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25179  return NULL;
25180  __Pyx_PyErr_Clear();
25181  Py_INCREF(d);
25182  return d;
25183 }
25184 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
25185  PyObject *r = __Pyx_GetAttr(o, n);
25186  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
25187 }
25188 
25189 /* PyDictVersioning */
25190 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
25191 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
25192  PyObject *dict = Py_TYPE(obj)->tp_dict;
25193  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
25194 }
25195 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
25196  PyObject **dictptr = NULL;
25197  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
25198  if (offset) {
25199 #if CYTHON_COMPILING_IN_CPYTHON
25200  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
25201 #else
25202  dictptr = _PyObject_GetDictPtr(obj);
25203 #endif
25204  }
25205  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
25206 }
25207 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
25208  PyObject *dict = Py_TYPE(obj)->tp_dict;
25209  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
25210  return 0;
25211  return obj_dict_version == __Pyx_get_object_dict_version(obj);
25212 }
25213 #endif
25214 
25215 /* GetModuleGlobalName */
25216 #if CYTHON_USE_DICT_VERSIONS
25217 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
25218 #else
25219 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
25220 #endif
25221 {
25222  PyObject *result;
25223 #if !CYTHON_AVOID_BORROWED_REFS
25224 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
25225  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
25226  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25227  if (likely(result)) {
25228  return __Pyx_NewRef(result);
25229  } else if (unlikely(PyErr_Occurred())) {
25230  return NULL;
25231  }
25232 #else
25233  result = PyDict_GetItem(__pyx_d, name);
25234  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25235  if (likely(result)) {
25236  return __Pyx_NewRef(result);
25237  }
25238 #endif
25239 #else
25240  result = PyObject_GetItem(__pyx_d, name);
25241  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25242  if (likely(result)) {
25243  return __Pyx_NewRef(result);
25244  }
25245  PyErr_Clear();
25246 #endif
25247  return __Pyx_GetBuiltinName(name);
25248 }
25249 
25250 /* SwapException */
25251 #if CYTHON_FAST_THREAD_STATE
25252 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25253  PyObject *tmp_type, *tmp_value, *tmp_tb;
25254  #if CYTHON_USE_EXC_INFO_STACK
25255  _PyErr_StackItem *exc_info = tstate->exc_info;
25256  tmp_type = exc_info->exc_type;
25257  tmp_value = exc_info->exc_value;
25258  tmp_tb = exc_info->exc_traceback;
25259  exc_info->exc_type = *type;
25260  exc_info->exc_value = *value;
25261  exc_info->exc_traceback = *tb;
25262  #else
25263  tmp_type = tstate->exc_type;
25264  tmp_value = tstate->exc_value;
25265  tmp_tb = tstate->exc_traceback;
25266  tstate->exc_type = *type;
25267  tstate->exc_value = *value;
25268  tstate->exc_traceback = *tb;
25269  #endif
25270  *type = tmp_type;
25271  *value = tmp_value;
25272  *tb = tmp_tb;
25273 }
25274 #else
25275 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25276  PyObject *tmp_type, *tmp_value, *tmp_tb;
25277  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25278  PyErr_SetExcInfo(*type, *value, *tb);
25279  *type = tmp_type;
25280  *value = tmp_value;
25281  *tb = tmp_tb;
25282 }
25283 #endif
25284 
25285 /* Import */
25286 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
25287  PyObject *empty_list = 0;
25288  PyObject *module = 0;
25289  PyObject *global_dict = 0;
25290  PyObject *empty_dict = 0;
25291  PyObject *list;
25292  #if PY_MAJOR_VERSION < 3
25293  PyObject *py_import;
25294  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25295  if (!py_import)
25296  goto bad;
25297  #endif
25298  if (from_list)
25299  list = from_list;
25300  else {
25301  empty_list = PyList_New(0);
25302  if (!empty_list)
25303  goto bad;
25304  list = empty_list;
25305  }
25306  global_dict = PyModule_GetDict(__pyx_m);
25307  if (!global_dict)
25308  goto bad;
25309  empty_dict = PyDict_New();
25310  if (!empty_dict)
25311  goto bad;
25312  {
25313  #if PY_MAJOR_VERSION >= 3
25314  if (level == -1) {
25315  if (strchr(__Pyx_MODULE_NAME, '.')) {
25316  module = PyImport_ImportModuleLevelObject(
25317  name, global_dict, empty_dict, list, 1);
25318  if (!module) {
25319  if (!PyErr_ExceptionMatches(PyExc_ImportError))
25320  goto bad;
25321  PyErr_Clear();
25322  }
25323  }
25324  level = 0;
25325  }
25326  #endif
25327  if (!module) {
25328  #if PY_MAJOR_VERSION < 3
25329  PyObject *py_level = PyInt_FromLong(level);
25330  if (!py_level)
25331  goto bad;
25332  module = PyObject_CallFunctionObjArgs(py_import,
25333  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25334  Py_DECREF(py_level);
25335  #else
25336  module = PyImport_ImportModuleLevelObject(
25337  name, global_dict, empty_dict, list, level);
25338  #endif
25339  }
25340  }
25341 bad:
25342  #if PY_MAJOR_VERSION < 3
25343  Py_XDECREF(py_import);
25344  #endif
25345  Py_XDECREF(empty_list);
25346  Py_XDECREF(empty_dict);
25347  return module;
25348 }
25349 
25350 /* FastTypeChecks */
25351 #if CYTHON_COMPILING_IN_CPYTHON
25352 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25353  while (a) {
25354  a = a->tp_base;
25355  if (a == b)
25356  return 1;
25357  }
25358  return b == &PyBaseObject_Type;
25359 }
25360 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25361  PyObject *mro;
25362  if (a == b) return 1;
25363  mro = a->tp_mro;
25364  if (likely(mro)) {
25365  Py_ssize_t i, n;
25366  n = PyTuple_GET_SIZE(mro);
25367  for (i = 0; i < n; i++) {
25368  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25369  return 1;
25370  }
25371  return 0;
25372  }
25373  return __Pyx_InBases(a, b);
25374 }
25375 #if PY_MAJOR_VERSION == 2
25376 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25377  PyObject *exception, *value, *tb;
25378  int res;
25379  __Pyx_PyThreadState_declare
25380  __Pyx_PyThreadState_assign
25381  __Pyx_ErrFetch(&exception, &value, &tb);
25382  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25383  if (unlikely(res == -1)) {
25384  PyErr_WriteUnraisable(err);
25385  res = 0;
25386  }
25387  if (!res) {
25388  res = PyObject_IsSubclass(err, exc_type2);
25389  if (unlikely(res == -1)) {
25390  PyErr_WriteUnraisable(err);
25391  res = 0;
25392  }
25393  }
25394  __Pyx_ErrRestore(exception, value, tb);
25395  return res;
25396 }
25397 #else
25398 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25399  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25400  if (!res) {
25401  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25402  }
25403  return res;
25404 }
25405 #endif
25406 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25407  Py_ssize_t i, n;
25408  assert(PyExceptionClass_Check(exc_type));
25409  n = PyTuple_GET_SIZE(tuple);
25410 #if PY_MAJOR_VERSION >= 3
25411  for (i=0; i<n; i++) {
25412  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25413  }
25414 #endif
25415  for (i=0; i<n; i++) {
25416  PyObject *t = PyTuple_GET_ITEM(tuple, i);
25417  #if PY_MAJOR_VERSION < 3
25418  if (likely(exc_type == t)) return 1;
25419  #endif
25420  if (likely(PyExceptionClass_Check(t))) {
25421  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
25422  } else {
25423  }
25424  }
25425  return 0;
25426 }
25427 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25428  if (likely(err == exc_type)) return 1;
25429  if (likely(PyExceptionClass_Check(err))) {
25430  if (likely(PyExceptionClass_Check(exc_type))) {
25431  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25432  } else if (likely(PyTuple_Check(exc_type))) {
25433  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25434  } else {
25435  }
25436  }
25437  return PyErr_GivenExceptionMatches(err, exc_type);
25438 }
25439 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25440  assert(PyExceptionClass_Check(exc_type1));
25441  assert(PyExceptionClass_Check(exc_type2));
25442  if (likely(err == exc_type1 || err == exc_type2)) return 1;
25443  if (likely(PyExceptionClass_Check(err))) {
25444  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25445  }
25446  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25447 }
25448 #endif
25449 
25450 /* None */
25451 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
25452  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
25453 }
25454 
25455 /* None */
25456 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
25457  long q = a / b;
25458  long r = a - q*b;
25459  q -= ((r != 0) & ((r ^ b) < 0));
25460  return q;
25461 }
25462 
25463 /* ImportFrom */
25464 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25465  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25466  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25467  PyErr_Format(PyExc_ImportError,
25468  #if PY_MAJOR_VERSION < 3
25469  "cannot import name %.230s", PyString_AS_STRING(name));
25470  #else
25471  "cannot import name %S", name);
25472  #endif
25473  }
25474  return value;
25475 }
25476 
25477 /* HasAttr */
25478 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25479  PyObject *r;
25480  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25481  PyErr_SetString(PyExc_TypeError,
25482  "hasattr(): attribute name must be string");
25483  return -1;
25484  }
25485  r = __Pyx_GetAttr(o, n);
25486  if (unlikely(!r)) {
25487  PyErr_Clear();
25488  return 0;
25489  } else {
25490  Py_DECREF(r);
25491  return 1;
25492  }
25493 }
25494 
25495 /* PyObject_GenericGetAttrNoDict */
25496 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25497 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25498  PyErr_Format(PyExc_AttributeError,
25499 #if PY_MAJOR_VERSION >= 3
25500  "'%.50s' object has no attribute '%U'",
25501  tp->tp_name, attr_name);
25502 #else
25503  "'%.50s' object has no attribute '%.400s'",
25504  tp->tp_name, PyString_AS_STRING(attr_name));
25505 #endif
25506  return NULL;
25507 }
25508 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25509  PyObject *descr;
25510  PyTypeObject *tp = Py_TYPE(obj);
25511  if (unlikely(!PyString_Check(attr_name))) {
25512  return PyObject_GenericGetAttr(obj, attr_name);
25513  }
25514  assert(!tp->tp_dictoffset);
25515  descr = _PyType_Lookup(tp, attr_name);
25516  if (unlikely(!descr)) {
25517  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25518  }
25519  Py_INCREF(descr);
25520  #if PY_MAJOR_VERSION < 3
25521  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25522  #endif
25523  {
25524  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
25525  if (unlikely(f)) {
25526  PyObject *res = f(descr, obj, (PyObject *)tp);
25527  Py_DECREF(descr);
25528  return res;
25529  }
25530  }
25531  return descr;
25532 }
25533 #endif
25534 
25535 /* PyObject_GenericGetAttr */
25536 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25537 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25538  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25539  return PyObject_GenericGetAttr(obj, attr_name);
25540  }
25541  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25542 }
25543 #endif
25544 
25545 /* SetupReduce */
25546 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25547  int ret;
25548  PyObject *name_attr;
25549  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25550  if (likely(name_attr)) {
25551  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25552  } else {
25553  ret = -1;
25554  }
25555  if (unlikely(ret < 0)) {
25556  PyErr_Clear();
25557  ret = 0;
25558  }
25559  Py_XDECREF(name_attr);
25560  return ret;
25561 }
25562 static int __Pyx_setup_reduce(PyObject* type_obj) {
25563  int ret = 0;
25564  PyObject *object_reduce = NULL;
25565  PyObject *object_reduce_ex = NULL;
25566  PyObject *reduce = NULL;
25567  PyObject *reduce_ex = NULL;
25568  PyObject *reduce_cython = NULL;
25569  PyObject *setstate = NULL;
25570  PyObject *setstate_cython = NULL;
25571 #if CYTHON_USE_PYTYPE_LOOKUP
25572  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
25573 #else
25574  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
25575 #endif
25576 #if CYTHON_USE_PYTYPE_LOOKUP
25577  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25578 #else
25579  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25580 #endif
25581  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
25582  if (reduce_ex == object_reduce_ex) {
25583 #if CYTHON_USE_PYTYPE_LOOKUP
25584  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25585 #else
25586  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25587 #endif
25588  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
25589  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25590  reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto __PYX_BAD;
25591  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25592  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25593  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25594  if (!setstate) PyErr_Clear();
25595  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25596  setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto __PYX_BAD;
25597  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25598  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25599  }
25600  PyType_Modified((PyTypeObject*)type_obj);
25601  }
25602  }
25603  goto __PYX_GOOD;
25604 __PYX_BAD:
25605  if (!PyErr_Occurred())
25606  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
25607  ret = -1;
25608 __PYX_GOOD:
25609 #if !CYTHON_USE_PYTYPE_LOOKUP
25610  Py_XDECREF(object_reduce);
25611  Py_XDECREF(object_reduce_ex);
25612 #endif
25613  Py_XDECREF(reduce);
25614  Py_XDECREF(reduce_ex);
25615  Py_XDECREF(reduce_cython);
25616  Py_XDECREF(setstate);
25617  Py_XDECREF(setstate_cython);
25618  return ret;
25619 }
25620 
25621 /* SetVTable */
25622 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
25623 #if PY_VERSION_HEX >= 0x02070000
25624  PyObject *ob = PyCapsule_New(vtable, 0, 0);
25625 #else
25626  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25627 #endif
25628  if (!ob)
25629  goto bad;
25630  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25631  goto bad;
25632  Py_DECREF(ob);
25633  return 0;
25634 bad:
25635  Py_XDECREF(ob);
25636  return -1;
25637 }
25638 
25639 /* TypeImport */
25640 #ifndef __PYX_HAVE_RT_ImportType
25641 #define __PYX_HAVE_RT_ImportType
25642 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
25643  size_t size, enum __Pyx_ImportType_CheckSize check_size)
25644 {
25645  PyObject *result = 0;
25646  char warning[200];
25647  Py_ssize_t basicsize;
25648 #ifdef Py_LIMITED_API
25649  PyObject *py_basicsize;
25650 #endif
25651  result = PyObject_GetAttrString(module, class_name);
25652  if (!result)
25653  goto bad;
25654  if (!PyType_Check(result)) {
25655  PyErr_Format(PyExc_TypeError,
25656  "%.200s.%.200s is not a type object",
25657  module_name, class_name);
25658  goto bad;
25659  }
25660 #ifndef Py_LIMITED_API
25661  basicsize = ((PyTypeObject *)result)->tp_basicsize;
25662 #else
25663  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
25664  if (!py_basicsize)
25665  goto bad;
25666  basicsize = PyLong_AsSsize_t(py_basicsize);
25667  Py_DECREF(py_basicsize);
25668  py_basicsize = 0;
25669  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25670  goto bad;
25671 #endif
25672  if ((size_t)basicsize < size) {
25673  PyErr_Format(PyExc_ValueError,
25674  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25675  "Expected %zd from C header, got %zd from PyObject",
25676  module_name, class_name, size, basicsize);
25677  goto bad;
25678  }
25679  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
25680  PyErr_Format(PyExc_ValueError,
25681  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25682  "Expected %zd from C header, got %zd from PyObject",
25683  module_name, class_name, size, basicsize);
25684  goto bad;
25685  }
25686  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
25687  PyOS_snprintf(warning, sizeof(warning),
25688  "%s.%s size changed, may indicate binary incompatibility. "
25689  "Expected %zd from C header, got %zd from PyObject",
25690  module_name, class_name, size, basicsize);
25691  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
25692  }
25693  return (PyTypeObject *)result;
25694 bad:
25695  Py_XDECREF(result);
25696  return NULL;
25697 }
25698 #endif
25699 
25700 /* CalculateMetaclass */
25701 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
25702  Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
25703  for (i=0; i < nbases; i++) {
25704  PyTypeObject *tmptype;
25705  PyObject *tmp = PyTuple_GET_ITEM(bases, i);
25706  tmptype = Py_TYPE(tmp);
25707 #if PY_MAJOR_VERSION < 3
25708  if (tmptype == &PyClass_Type)
25709  continue;
25710 #endif
25711  if (!metaclass) {
25712  metaclass = tmptype;
25713  continue;
25714  }
25715  if (PyType_IsSubtype(metaclass, tmptype))
25716  continue;
25717  if (PyType_IsSubtype(tmptype, metaclass)) {
25718  metaclass = tmptype;
25719  continue;
25720  }
25721  PyErr_SetString(PyExc_TypeError,
25722  "metaclass conflict: "
25723  "the metaclass of a derived class "
25724  "must be a (non-strict) subclass "
25725  "of the metaclasses of all its bases");
25726  return NULL;
25727  }
25728  if (!metaclass) {
25729 #if PY_MAJOR_VERSION < 3
25730  metaclass = &PyClass_Type;
25731 #else
25732  metaclass = &PyType_Type;
25733 #endif
25734  }
25735  Py_INCREF((PyObject*) metaclass);
25736  return (PyObject*) metaclass;
25737 }
25738 
25739 /* FetchCommonType */
25740 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
25741  PyObject* fake_module;
25742  PyTypeObject* cached_type = NULL;
25743  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
25744  if (!fake_module) return NULL;
25745  Py_INCREF(fake_module);
25746  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
25747  if (cached_type) {
25748  if (!PyType_Check((PyObject*)cached_type)) {
25749  PyErr_Format(PyExc_TypeError,
25750  "Shared Cython type %.200s is not a type object",
25751  type->tp_name);
25752  goto bad;
25753  }
25754  if (cached_type->tp_basicsize != type->tp_basicsize) {
25755  PyErr_Format(PyExc_TypeError,
25756  "Shared Cython type %.200s has the wrong size, try recompiling",
25757  type->tp_name);
25758  goto bad;
25759  }
25760  } else {
25761  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
25762  PyErr_Clear();
25763  if (PyType_Ready(type) < 0) goto bad;
25764  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
25765  goto bad;
25766  Py_INCREF(type);
25767  cached_type = type;
25768  }
25769 done:
25770  Py_DECREF(fake_module);
25771  return cached_type;
25772 bad:
25773  Py_XDECREF(cached_type);
25774  cached_type = NULL;
25775  goto done;
25776 }
25777 
25778 /* CythonFunction */
25779 #include <structmember.h>
25780 static PyObject *
25781 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
25782 {
25783  if (unlikely(op->func_doc == NULL)) {
25784  if (op->func.m_ml->ml_doc) {
25785 #if PY_MAJOR_VERSION >= 3
25786  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
25787 #else
25788  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
25789 #endif
25790  if (unlikely(op->func_doc == NULL))
25791  return NULL;
25792  } else {
25793  Py_INCREF(Py_None);
25794  return Py_None;
25795  }
25796  }
25797  Py_INCREF(op->func_doc);
25798  return op->func_doc;
25799 }
25800 static int
25801 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25802 {
25803  PyObject *tmp = op->func_doc;
25804  if (value == NULL) {
25805  value = Py_None;
25806  }
25807  Py_INCREF(value);
25808  op->func_doc = value;
25809  Py_XDECREF(tmp);
25810  return 0;
25811 }
25812 static PyObject *
25813 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25814 {
25815  if (unlikely(op->func_name == NULL)) {
25816 #if PY_MAJOR_VERSION >= 3
25817  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
25818 #else
25819  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
25820 #endif
25821  if (unlikely(op->func_name == NULL))
25822  return NULL;
25823  }
25824  Py_INCREF(op->func_name);
25825  return op->func_name;
25826 }
25827 static int
25828 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25829 {
25830  PyObject *tmp;
25831 #if PY_MAJOR_VERSION >= 3
25832  if (unlikely(value == NULL || !PyUnicode_Check(value)))
25833 #else
25834  if (unlikely(value == NULL || !PyString_Check(value)))
25835 #endif
25836  {
25837  PyErr_SetString(PyExc_TypeError,
25838  "__name__ must be set to a string object");
25839  return -1;
25840  }
25841  tmp = op->func_name;
25842  Py_INCREF(value);
25843  op->func_name = value;
25844  Py_XDECREF(tmp);
25845  return 0;
25846 }
25847 static PyObject *
25848 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25849 {
25850  Py_INCREF(op->func_qualname);
25851  return op->func_qualname;
25852 }
25853 static int
25854 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25855 {
25856  PyObject *tmp;
25857 #if PY_MAJOR_VERSION >= 3
25858  if (unlikely(value == NULL || !PyUnicode_Check(value)))
25859 #else
25860  if (unlikely(value == NULL || !PyString_Check(value)))
25861 #endif
25862  {
25863  PyErr_SetString(PyExc_TypeError,
25864  "__qualname__ must be set to a string object");
25865  return -1;
25866  }
25867  tmp = op->func_qualname;
25868  Py_INCREF(value);
25869  op->func_qualname = value;
25870  Py_XDECREF(tmp);
25871  return 0;
25872 }
25873 static PyObject *
25874 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
25875 {
25876  PyObject *self;
25877  self = m->func_closure;
25878  if (self == NULL)
25879  self = Py_None;
25880  Py_INCREF(self);
25881  return self;
25882 }
25883 static PyObject *
25884 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25885 {
25886  if (unlikely(op->func_dict == NULL)) {
25887  op->func_dict = PyDict_New();
25888  if (unlikely(op->func_dict == NULL))
25889  return NULL;
25890  }
25891  Py_INCREF(op->func_dict);
25892  return op->func_dict;
25893 }
25894 static int
25895 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25896 {
25897  PyObject *tmp;
25898  if (unlikely(value == NULL)) {
25899  PyErr_SetString(PyExc_TypeError,
25900  "function's dictionary may not be deleted");
25901  return -1;
25902  }
25903  if (unlikely(!PyDict_Check(value))) {
25904  PyErr_SetString(PyExc_TypeError,
25905  "setting function's dictionary to a non-dict");
25906  return -1;
25907  }
25908  tmp = op->func_dict;
25909  Py_INCREF(value);
25910  op->func_dict = value;
25911  Py_XDECREF(tmp);
25912  return 0;
25913 }
25914 static PyObject *
25915 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25916 {
25917  Py_INCREF(op->func_globals);
25918  return op->func_globals;
25919 }
25920 static PyObject *
25921 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25922 {
25923  Py_INCREF(Py_None);
25924  return Py_None;
25925 }
25926 static PyObject *
25927 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25928 {
25929  PyObject* result = (op->func_code) ? op->func_code : Py_None;
25930  Py_INCREF(result);
25931  return result;
25932 }
25933 static int
25934 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
25935  int result = 0;
25936  PyObject *res = op->defaults_getter((PyObject *) op);
25937  if (unlikely(!res))
25938  return -1;
25939  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25940  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
25941  Py_INCREF(op->defaults_tuple);
25942  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
25943  Py_INCREF(op->defaults_kwdict);
25944  #else
25945  op->defaults_tuple = PySequence_ITEM(res, 0);
25946  if (unlikely(!op->defaults_tuple)) result = -1;
25947  else {
25948  op->defaults_kwdict = PySequence_ITEM(res, 1);
25949  if (unlikely(!op->defaults_kwdict)) result = -1;
25950  }
25951  #endif
25952  Py_DECREF(res);
25953  return result;
25954 }
25955 static int
25956 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25957  PyObject* tmp;
25958  if (!value) {
25959  value = Py_None;
25960  } else if (value != Py_None && !PyTuple_Check(value)) {
25961  PyErr_SetString(PyExc_TypeError,
25962  "__defaults__ must be set to a tuple object");
25963  return -1;
25964  }
25965  Py_INCREF(value);
25966  tmp = op->defaults_tuple;
25967  op->defaults_tuple = value;
25968  Py_XDECREF(tmp);
25969  return 0;
25970 }
25971 static PyObject *
25972 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
25973  PyObject* result = op->defaults_tuple;
25974  if (unlikely(!result)) {
25975  if (op->defaults_getter) {
25976  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
25977  result = op->defaults_tuple;
25978  } else {
25979  result = Py_None;
25980  }
25981  }
25982  Py_INCREF(result);
25983  return result;
25984 }
25985 static int
25986 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25987  PyObject* tmp;
25988  if (!value) {
25989  value = Py_None;
25990  } else if (value != Py_None && !PyDict_Check(value)) {
25991  PyErr_SetString(PyExc_TypeError,
25992  "__kwdefaults__ must be set to a dict object");
25993  return -1;
25994  }
25995  Py_INCREF(value);
25996  tmp = op->defaults_kwdict;
25997  op->defaults_kwdict = value;
25998  Py_XDECREF(tmp);
25999  return 0;
26000 }
26001 static PyObject *
26002 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26003  PyObject* result = op->defaults_kwdict;
26004  if (unlikely(!result)) {
26005  if (op->defaults_getter) {
26006  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
26007  result = op->defaults_kwdict;
26008  } else {
26009  result = Py_None;
26010  }
26011  }
26012  Py_INCREF(result);
26013  return result;
26014 }
26015 static int
26016 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
26017  PyObject* tmp;
26018  if (!value || value == Py_None) {
26019  value = NULL;
26020  } else if (!PyDict_Check(value)) {
26021  PyErr_SetString(PyExc_TypeError,
26022  "__annotations__ must be set to a dict object");
26023  return -1;
26024  }
26025  Py_XINCREF(value);
26026  tmp = op->func_annotations;
26027  op->func_annotations = value;
26028  Py_XDECREF(tmp);
26029  return 0;
26030 }
26031 static PyObject *
26032 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26033  PyObject* result = op->func_annotations;
26034  if (unlikely(!result)) {
26035  result = PyDict_New();
26036  if (unlikely(!result)) return NULL;
26037  op->func_annotations = result;
26038  }
26039  Py_INCREF(result);
26040  return result;
26041 }
26042 static PyGetSetDef __pyx_CyFunction_getsets[] = {
26043  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26044  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26045  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26046  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26047  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
26048  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
26049  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26050  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26051  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26052  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26053  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26054  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26055  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26056  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26057  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26058  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26059  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
26060  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
26061  {0, 0, 0, 0, 0}
26062 };
26063 static PyMemberDef __pyx_CyFunction_members[] = {
26064  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
26065  {0, 0, 0, 0, 0}
26066 };
26067 static PyObject *
26068 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
26069 {
26070 #if PY_MAJOR_VERSION >= 3
26071  return PyUnicode_FromString(m->func.m_ml->ml_name);
26072 #else
26073  return PyString_FromString(m->func.m_ml->ml_name);
26074 #endif
26075 }
26076 static PyMethodDef __pyx_CyFunction_methods[] = {
26077  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
26078  {0, 0, 0, 0}
26079 };
26080 #if PY_VERSION_HEX < 0x030500A0
26081 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
26082 #else
26083 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
26084 #endif
26085 static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
26086  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26087  __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
26088  if (op == NULL)
26089  return NULL;
26090  op->flags = flags;
26091  __Pyx_CyFunction_weakreflist(op) = NULL;
26092  op->func.m_ml = ml;
26093  op->func.m_self = (PyObject *) op;
26094  Py_XINCREF(closure);
26095  op->func_closure = closure;
26096  Py_XINCREF(module);
26097  op->func.m_module = module;
26098  op->func_dict = NULL;
26099  op->func_name = NULL;
26100  Py_INCREF(qualname);
26101  op->func_qualname = qualname;
26102  op->func_doc = NULL;
26103  op->func_classobj = NULL;
26104  op->func_globals = globals;
26105  Py_INCREF(op->func_globals);
26106  Py_XINCREF(code);
26107  op->func_code = code;
26108  op->defaults_pyobjects = 0;
26109  op->defaults_size = 0;
26110  op->defaults = NULL;
26111  op->defaults_tuple = NULL;
26112  op->defaults_kwdict = NULL;
26113  op->defaults_getter = NULL;
26114  op->func_annotations = NULL;
26115  PyObject_GC_Track(op);
26116  return (PyObject *) op;
26117 }
26118 static int
26119 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
26120 {
26121  Py_CLEAR(m->func_closure);
26122  Py_CLEAR(m->func.m_module);
26123  Py_CLEAR(m->func_dict);
26124  Py_CLEAR(m->func_name);
26125  Py_CLEAR(m->func_qualname);
26126  Py_CLEAR(m->func_doc);
26127  Py_CLEAR(m->func_globals);
26128  Py_CLEAR(m->func_code);
26129  Py_CLEAR(m->func_classobj);
26130  Py_CLEAR(m->defaults_tuple);
26131  Py_CLEAR(m->defaults_kwdict);
26132  Py_CLEAR(m->func_annotations);
26133  if (m->defaults) {
26134  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26135  int i;
26136  for (i = 0; i < m->defaults_pyobjects; i++)
26137  Py_XDECREF(pydefaults[i]);
26138  PyObject_Free(m->defaults);
26139  m->defaults = NULL;
26140  }
26141  return 0;
26142 }
26143 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
26144 {
26145  if (__Pyx_CyFunction_weakreflist(m) != NULL)
26146  PyObject_ClearWeakRefs((PyObject *) m);
26147  __Pyx_CyFunction_clear(m);
26148  PyObject_GC_Del(m);
26149 }
26150 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
26151 {
26152  PyObject_GC_UnTrack(m);
26153  __Pyx__CyFunction_dealloc(m);
26154 }
26155 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
26156 {
26157  Py_VISIT(m->func_closure);
26158  Py_VISIT(m->func.m_module);
26159  Py_VISIT(m->func_dict);
26160  Py_VISIT(m->func_name);
26161  Py_VISIT(m->func_qualname);
26162  Py_VISIT(m->func_doc);
26163  Py_VISIT(m->func_globals);
26164  Py_VISIT(m->func_code);
26165  Py_VISIT(m->func_classobj);
26166  Py_VISIT(m->defaults_tuple);
26167  Py_VISIT(m->defaults_kwdict);
26168  if (m->defaults) {
26169  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26170  int i;
26171  for (i = 0; i < m->defaults_pyobjects; i++)
26172  Py_VISIT(pydefaults[i]);
26173  }
26174  return 0;
26175 }
26176 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
26177 {
26178  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26179  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
26180  Py_INCREF(func);
26181  return func;
26182  }
26183  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
26184  if (type == NULL)
26185  type = (PyObject *)(Py_TYPE(obj));
26186  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
26187  }
26188  if (obj == Py_None)
26189  obj = NULL;
26190  return __Pyx_PyMethod_New(func, obj, type);
26191 }
26192 static PyObject*
26193 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
26194 {
26195 #if PY_MAJOR_VERSION >= 3
26196  return PyUnicode_FromFormat("<cyfunction %U at %p>",
26197  op->func_qualname, (void *)op);
26198 #else
26199  return PyString_FromFormat("<cyfunction %s at %p>",
26200  PyString_AsString(op->func_qualname), (void *)op);
26201 #endif
26202 }
26203 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
26204  PyCFunctionObject* f = (PyCFunctionObject*)func;
26205  PyCFunction meth = f->m_ml->ml_meth;
26206  Py_ssize_t size;
26207  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
26208  case METH_VARARGS:
26209  if (likely(kw == NULL || PyDict_Size(kw) == 0))
26210  return (*meth)(self, arg);
26211  break;
26212  case METH_VARARGS | METH_KEYWORDS:
26213  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
26214  case METH_NOARGS:
26215  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26216  size = PyTuple_GET_SIZE(arg);
26217  if (likely(size == 0))
26218  return (*meth)(self, NULL);
26219  PyErr_Format(PyExc_TypeError,
26220  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
26221  f->m_ml->ml_name, size);
26222  return NULL;
26223  }
26224  break;
26225  case METH_O:
26226  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26227  size = PyTuple_GET_SIZE(arg);
26228  if (likely(size == 1)) {
26229  PyObject *result, *arg0;
26230  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26231  arg0 = PyTuple_GET_ITEM(arg, 0);
26232  #else
26233  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
26234  #endif
26235  result = (*meth)(self, arg0);
26236  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26237  Py_DECREF(arg0);
26238  #endif
26239  return result;
26240  }
26241  PyErr_Format(PyExc_TypeError,
26242  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
26243  f->m_ml->ml_name, size);
26244  return NULL;
26245  }
26246  break;
26247  default:
26248  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
26249  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26250  "longer supported!");
26251  return NULL;
26252  }
26253  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
26254  f->m_ml->ml_name);
26255  return NULL;
26256 }
26257 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26258  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26259 }
26260 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26261  PyObject *result;
26262  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26263  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26264  Py_ssize_t argc;
26265  PyObject *new_args;
26266  PyObject *self;
26267  argc = PyTuple_GET_SIZE(args);
26268  new_args = PyTuple_GetSlice(args, 1, argc);
26269  if (unlikely(!new_args))
26270  return NULL;
26271  self = PyTuple_GetItem(args, 0);
26272  if (unlikely(!self)) {
26273  Py_DECREF(new_args);
26274  return NULL;
26275  }
26276  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
26277  Py_DECREF(new_args);
26278  } else {
26279  result = __Pyx_CyFunction_Call(func, args, kw);
26280  }
26281  return result;
26282 }
26283 static PyTypeObject __pyx_CyFunctionType_type = {
26284  PyVarObject_HEAD_INIT(0, 0)
26285  "cython_function_or_method",
26286  sizeof(__pyx_CyFunctionObject),
26287  0,
26288  (destructor) __Pyx_CyFunction_dealloc,
26289  0,
26290  0,
26291  0,
26292 #if PY_MAJOR_VERSION < 3
26293  0,
26294 #else
26295  0,
26296 #endif
26297  (reprfunc) __Pyx_CyFunction_repr,
26298  0,
26299  0,
26300  0,
26301  0,
26302  __Pyx_CyFunction_CallAsMethod,
26303  0,
26304  0,
26305  0,
26306  0,
26307  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
26308  0,
26309  (traverseproc) __Pyx_CyFunction_traverse,
26310  (inquiry) __Pyx_CyFunction_clear,
26311  0,
26312 #if PY_VERSION_HEX < 0x030500A0
26313  offsetof(__pyx_CyFunctionObject, func_weakreflist),
26314 #else
26315  offsetof(PyCFunctionObject, m_weakreflist),
26316 #endif
26317  0,
26318  0,
26319  __pyx_CyFunction_methods,
26320  __pyx_CyFunction_members,
26321  __pyx_CyFunction_getsets,
26322  0,
26323  0,
26324  __Pyx_CyFunction_descr_get,
26325  0,
26326  offsetof(__pyx_CyFunctionObject, func_dict),
26327  0,
26328  0,
26329  0,
26330  0,
26331  0,
26332  0,
26333  0,
26334  0,
26335  0,
26336  0,
26337  0,
26338  0,
26339 #if PY_VERSION_HEX >= 0x030400a1
26340  0,
26341 #endif
26342 #if PY_VERSION_HEX >= 0x030800b1
26343  0,
26344 #endif
26345 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26346  0,
26347 #endif
26348 };
26349 static int __pyx_CyFunction_init(void) {
26350  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
26351  if (unlikely(__pyx_CyFunctionType == NULL)) {
26352  return -1;
26353  }
26354  return 0;
26355 }
26356 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
26357  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26358  m->defaults = PyObject_Malloc(size);
26359  if (unlikely(!m->defaults))
26360  return PyErr_NoMemory();
26361  memset(m->defaults, 0, size);
26362  m->defaults_pyobjects = pyobjects;
26363  m->defaults_size = size;
26364  return m->defaults;
26365 }
26366 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
26367  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26368  m->defaults_tuple = tuple;
26369  Py_INCREF(tuple);
26370 }
26371 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
26372  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26373  m->defaults_kwdict = dict;
26374  Py_INCREF(dict);
26375 }
26376 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
26377  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26378  m->func_annotations = dict;
26379  Py_INCREF(dict);
26380 }
26381 
26382 /* Py3ClassCreate */
26383 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
26384  PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
26385  PyObject *ns;
26386  if (metaclass) {
26387  PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
26388  if (prep) {
26389  PyObject *pargs = PyTuple_Pack(2, name, bases);
26390  if (unlikely(!pargs)) {
26391  Py_DECREF(prep);
26392  return NULL;
26393  }
26394  ns = PyObject_Call(prep, pargs, mkw);
26395  Py_DECREF(prep);
26396  Py_DECREF(pargs);
26397  } else {
26398  if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
26399  return NULL;
26400  PyErr_Clear();
26401  ns = PyDict_New();
26402  }
26403  } else {
26404  ns = PyDict_New();
26405  }
26406  if (unlikely(!ns))
26407  return NULL;
26408  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
26409  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
26410  if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
26411  return ns;
26412 bad:
26413  Py_DECREF(ns);
26414  return NULL;
26415 }
26416 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
26417  PyObject *dict, PyObject *mkw,
26418  int calculate_metaclass, int allow_py2_metaclass) {
26419  PyObject *result, *margs;
26420  PyObject *owned_metaclass = NULL;
26421  if (allow_py2_metaclass) {
26422  owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
26423  if (owned_metaclass) {
26424  metaclass = owned_metaclass;
26425  } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
26426  PyErr_Clear();
26427  } else {
26428  return NULL;
26429  }
26430  }
26431  if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
26432  metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
26433  Py_XDECREF(owned_metaclass);
26434  if (unlikely(!metaclass))
26435  return NULL;
26436  owned_metaclass = metaclass;
26437  }
26438  margs = PyTuple_Pack(3, name, bases, dict);
26439  if (unlikely(!margs)) {
26440  result = NULL;
26441  } else {
26442  result = PyObject_Call(metaclass, margs, mkw);
26443  Py_DECREF(margs);
26444  }
26445  Py_XDECREF(owned_metaclass);
26446  return result;
26447 }
26448 
26449 /* CLineInTraceback */
26450 #ifndef CYTHON_CLINE_IN_TRACEBACK
26451 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
26452  PyObject *use_cline;
26453  PyObject *ptype, *pvalue, *ptraceback;
26454 #if CYTHON_COMPILING_IN_CPYTHON
26455  PyObject **cython_runtime_dict;
26456 #endif
26457  if (unlikely(!__pyx_cython_runtime)) {
26458  return c_line;
26459  }
26460  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26461 #if CYTHON_COMPILING_IN_CPYTHON
26462  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26463  if (likely(cython_runtime_dict)) {
26464  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
26465  use_cline, *cython_runtime_dict,
26466  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
26467  } else
26468 #endif
26469  {
26470  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26471  if (use_cline_obj) {
26472  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26473  Py_DECREF(use_cline_obj);
26474  } else {
26475  PyErr_Clear();
26476  use_cline = NULL;
26477  }
26478  }
26479  if (!use_cline) {
26480  c_line = 0;
26481  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26482  }
26483  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
26484  c_line = 0;
26485  }
26486  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26487  return c_line;
26488 }
26489 #endif
26490 
26491 /* CodeObjectCache */
26492 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
26493  int start = 0, mid = 0, end = count - 1;
26494  if (end >= 0 && code_line > entries[end].code_line) {
26495  return count;
26496  }
26497  while (start < end) {
26498  mid = start + (end - start) / 2;
26499  if (code_line < entries[mid].code_line) {
26500  end = mid;
26501  } else if (code_line > entries[mid].code_line) {
26502  start = mid + 1;
26503  } else {
26504  return mid;
26505  }
26506  }
26507  if (code_line <= entries[mid].code_line) {
26508  return mid;
26509  } else {
26510  return mid + 1;
26511  }
26512 }
26513 static PyCodeObject *__pyx_find_code_object(int code_line) {
26514  PyCodeObject* code_object;
26515  int pos;
26516  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26517  return NULL;
26518  }
26519  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26520  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
26521  return NULL;
26522  }
26523  code_object = __pyx_code_cache.entries[pos].code_object;
26524  Py_INCREF(code_object);
26525  return code_object;
26526 }
26527 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
26528  int pos, i;
26529  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26530  if (unlikely(!code_line)) {
26531  return;
26532  }
26533  if (unlikely(!entries)) {
26534  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
26535  if (likely(entries)) {
26536  __pyx_code_cache.entries = entries;
26537  __pyx_code_cache.max_count = 64;
26538  __pyx_code_cache.count = 1;
26539  entries[0].code_line = code_line;
26540  entries[0].code_object = code_object;
26541  Py_INCREF(code_object);
26542  }
26543  return;
26544  }
26545  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26546  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
26547  PyCodeObject* tmp = entries[pos].code_object;
26548  entries[pos].code_object = code_object;
26549  Py_DECREF(tmp);
26550  return;
26551  }
26552  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26553  int new_max = __pyx_code_cache.max_count + 64;
26554  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26555  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
26556  if (unlikely(!entries)) {
26557  return;
26558  }
26559  __pyx_code_cache.entries = entries;
26560  __pyx_code_cache.max_count = new_max;
26561  }
26562  for (i=__pyx_code_cache.count; i>pos; i--) {
26563  entries[i] = entries[i-1];
26564  }
26565  entries[pos].code_line = code_line;
26566  entries[pos].code_object = code_object;
26567  __pyx_code_cache.count++;
26568  Py_INCREF(code_object);
26569 }
26570 
26571 /* AddTraceback */
26572 #include "compile.h"
26573 #include "frameobject.h"
26574 #include "traceback.h"
26575 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26576  const char *funcname, int c_line,
26577  int py_line, const char *filename) {
26578  PyCodeObject *py_code = 0;
26579  PyObject *py_srcfile = 0;
26580  PyObject *py_funcname = 0;
26581  #if PY_MAJOR_VERSION < 3
26582  py_srcfile = PyString_FromString(filename);
26583  #else
26584  py_srcfile = PyUnicode_FromString(filename);
26585  #endif
26586  if (!py_srcfile) goto bad;
26587  if (c_line) {
26588  #if PY_MAJOR_VERSION < 3
26589  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26590  #else
26591  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26592  #endif
26593  }
26594  else {
26595  #if PY_MAJOR_VERSION < 3
26596  py_funcname = PyString_FromString(funcname);
26597  #else
26598  py_funcname = PyUnicode_FromString(funcname);
26599  #endif
26600  }
26601  if (!py_funcname) goto bad;
26602  py_code = __Pyx_PyCode_New(
26603  0,
26604  0,
26605  0,
26606  0,
26607  0,
26608  __pyx_empty_bytes, /*PyObject *code,*/
26609  __pyx_empty_tuple, /*PyObject *consts,*/
26610  __pyx_empty_tuple, /*PyObject *names,*/
26611  __pyx_empty_tuple, /*PyObject *varnames,*/
26612  __pyx_empty_tuple, /*PyObject *freevars,*/
26613  __pyx_empty_tuple, /*PyObject *cellvars,*/
26614  py_srcfile, /*PyObject *filename,*/
26615  py_funcname, /*PyObject *name,*/
26616  py_line,
26617  __pyx_empty_bytes /*PyObject *lnotab*/
26618  );
26619  Py_DECREF(py_srcfile);
26620  Py_DECREF(py_funcname);
26621  return py_code;
26622 bad:
26623  Py_XDECREF(py_srcfile);
26624  Py_XDECREF(py_funcname);
26625  return NULL;
26626 }
26627 static void __Pyx_AddTraceback(const char *funcname, int c_line,
26628  int py_line, const char *filename) {
26629  PyCodeObject *py_code = 0;
26630  PyFrameObject *py_frame = 0;
26631  PyThreadState *tstate = __Pyx_PyThreadState_Current;
26632  if (c_line) {
26633  c_line = __Pyx_CLineForTraceback(tstate, c_line);
26634  }
26635  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
26636  if (!py_code) {
26637  py_code = __Pyx_CreateCodeObjectForTraceback(
26638  funcname, c_line, py_line, filename);
26639  if (!py_code) goto bad;
26640  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
26641  }
26642  py_frame = PyFrame_New(
26643  tstate, /*PyThreadState *tstate,*/
26644  py_code, /*PyCodeObject *code,*/
26645  __pyx_d, /*PyObject *globals,*/
26646  0 /*PyObject *locals*/
26647  );
26648  if (!py_frame) goto bad;
26649  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26650  PyTraceBack_Here(py_frame);
26651 bad:
26652  Py_XDECREF(py_code);
26653  Py_XDECREF(py_frame);
26654 }
26655 
26656 #if PY_MAJOR_VERSION < 3
26657 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
26658  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
26659  if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
26660  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
26661  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
26662  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26663  return -1;
26664 }
26665 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26666  PyObject *obj = view->obj;
26667  if (!obj) return;
26668  if (PyObject_CheckBuffer(obj)) {
26669  PyBuffer_Release(view);
26670  return;
26671  }
26672  if ((0)) {}
26673  else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
26674  view->obj = NULL;
26675  Py_DECREF(obj);
26676 }
26677 #endif
26678 
26679 
26680 /* MemviewSliceIsContig */
26681 static int
26682 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
26683 {
26684  int i, index, step, start;
26685  Py_ssize_t itemsize = mvs.memview->view.itemsize;
26686  if (order == 'F') {
26687  step = 1;
26688  start = 0;
26689  } else {
26690  step = -1;
26691  start = ndim - 1;
26692  }
26693  for (i = 0; i < ndim; i++) {
26694  index = start + step * i;
26695  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26696  return 0;
26697  itemsize *= mvs.shape[index];
26698  }
26699  return 1;
26700 }
26701 
26702 /* OverlappingSlices */
26703 static void
26704 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26705  void **out_start, void **out_end,
26706  int ndim, size_t itemsize)
26707 {
26708  char *start, *end;
26709  int i;
26710  start = end = slice->data;
26711  for (i = 0; i < ndim; i++) {
26712  Py_ssize_t stride = slice->strides[i];
26713  Py_ssize_t extent = slice->shape[i];
26714  if (extent == 0) {
26715  *out_start = *out_end = start;
26716  return;
26717  } else {
26718  if (stride > 0)
26719  end += stride * (extent - 1);
26720  else
26721  start += stride * (extent - 1);
26722  }
26723  }
26724  *out_start = start;
26725  *out_end = end + itemsize;
26726 }
26727 static int
26728 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26729  __Pyx_memviewslice *slice2,
26730  int ndim, size_t itemsize)
26731 {
26732  void *start1, *end1, *start2, *end2;
26733  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26734  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26735  return (start1 < end2) && (start2 < end1);
26736 }
26737 
26738 /* Capsule */
26739 static CYTHON_INLINE PyObject *
26740 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
26741 {
26742  PyObject *cobj;
26743 #if PY_VERSION_HEX >= 0x02070000
26744  cobj = PyCapsule_New(p, sig, NULL);
26745 #else
26746  cobj = PyCObject_FromVoidPtr(p, NULL);
26747 #endif
26748  return cobj;
26749 }
26750 
26751 /* CIntFromPyVerify */
26752 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
26753  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
26754 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
26755  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
26756 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
26757  {\
26758  func_type value = func_value;\
26759  if (sizeof(target_type) < sizeof(func_type)) {\
26760  if (unlikely(value != (func_type) (target_type) value)) {\
26761  func_type zero = 0;\
26762  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
26763  return (target_type) -1;\
26764  if (is_unsigned && unlikely(value < zero))\
26765  goto raise_neg_overflow;\
26766  else\
26767  goto raise_overflow;\
26768  }\
26769  }\
26770  return (target_type) value;\
26771  }
26772 
26773 /* IsLittleEndian */
26774 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
26775 {
26776  union {
26777  uint32_t u32;
26778  uint8_t u8[4];
26779  } S;
26780  S.u32 = 0x01020304;
26781  return S.u8[0] == 4;
26782 }
26783 
26784 /* BufferFormatCheck */
26785 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
26786  __Pyx_BufFmt_StackElem* stack,
26787  __Pyx_TypeInfo* type) {
26788  stack[0].field = &ctx->root;
26789  stack[0].parent_offset = 0;
26790  ctx->root.type = type;
26791  ctx->root.name = "buffer dtype";
26792  ctx->root.offset = 0;
26793  ctx->head = stack;
26794  ctx->head->field = &ctx->root;
26795  ctx->fmt_offset = 0;
26796  ctx->head->parent_offset = 0;
26797  ctx->new_packmode = '@';
26798  ctx->enc_packmode = '@';
26799  ctx->new_count = 1;
26800  ctx->enc_count = 0;
26801  ctx->enc_type = 0;
26802  ctx->is_complex = 0;
26803  ctx->is_valid_array = 0;
26804  ctx->struct_alignment = 0;
26805  while (type->typegroup == 'S') {
26806  ++ctx->head;
26807  ctx->head->field = type->fields;
26808  ctx->head->parent_offset = 0;
26809  type = type->fields->type;
26810  }
26811 }
26812 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
26813  int count;
26814  const char* t = *ts;
26815  if (*t < '0' || *t > '9') {
26816  return -1;
26817  } else {
26818  count = *t++ - '0';
26819  while (*t >= '0' && *t <= '9') {
26820  count *= 10;
26821  count += *t++ - '0';
26822  }
26823  }
26824  *ts = t;
26825  return count;
26826 }
26827 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
26828  int number = __Pyx_BufFmt_ParseNumber(ts);
26829  if (number == -1)
26830  PyErr_Format(PyExc_ValueError,\
26831  "Does not understand character buffer dtype format string ('%c')", **ts);
26832  return number;
26833 }
26834 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
26835  PyErr_Format(PyExc_ValueError,
26836  "Unexpected format string character: '%c'", ch);
26837 }
26838 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
26839  switch (ch) {
26840  case '?': return "'bool'";
26841  case 'c': return "'char'";
26842  case 'b': return "'signed char'";
26843  case 'B': return "'unsigned char'";
26844  case 'h': return "'short'";
26845  case 'H': return "'unsigned short'";
26846  case 'i': return "'int'";
26847  case 'I': return "'unsigned int'";
26848  case 'l': return "'long'";
26849  case 'L': return "'unsigned long'";
26850  case 'q': return "'long long'";
26851  case 'Q': return "'unsigned long long'";
26852  case 'f': return (is_complex ? "'complex float'" : "'float'");
26853  case 'd': return (is_complex ? "'complex double'" : "'double'");
26854  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
26855  case 'T': return "a struct";
26856  case 'O': return "Python object";
26857  case 'P': return "a pointer";
26858  case 's': case 'p': return "a string";
26859  case 0: return "end";
26860  default: return "unparseable format string";
26861  }
26862 }
26863 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
26864  switch (ch) {
26865  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26866  case 'h': case 'H': return 2;
26867  case 'i': case 'I': case 'l': case 'L': return 4;
26868  case 'q': case 'Q': return 8;
26869  case 'f': return (is_complex ? 8 : 4);
26870  case 'd': return (is_complex ? 16 : 8);
26871  case 'g': {
26872  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
26873  return 0;
26874  }
26875  case 'O': case 'P': return sizeof(void*);
26876  default:
26877  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26878  return 0;
26879  }
26880 }
26881 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
26882  switch (ch) {
26883  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26884  case 'h': case 'H': return sizeof(short);
26885  case 'i': case 'I': return sizeof(int);
26886  case 'l': case 'L': return sizeof(long);
26887  #ifdef HAVE_LONG_LONG
26888  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
26889  #endif
26890  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
26891  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
26892  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
26893  case 'O': case 'P': return sizeof(void*);
26894  default: {
26895  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26896  return 0;
26897  }
26898  }
26899 }
26900 typedef struct { char c; short x; } __Pyx_st_short;
26901 typedef struct { char c; int x; } __Pyx_st_int;
26902 typedef struct { char c; long x; } __Pyx_st_long;
26903 typedef struct { char c; float x; } __Pyx_st_float;
26904 typedef struct { char c; double x; } __Pyx_st_double;
26905 typedef struct { char c; long double x; } __Pyx_st_longdouble;
26906 typedef struct { char c; void *x; } __Pyx_st_void_p;
26907 #ifdef HAVE_LONG_LONG
26908 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
26909 #endif
26910 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
26911  switch (ch) {
26912  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26913  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
26914  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
26915  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
26916 #ifdef HAVE_LONG_LONG
26917  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
26918 #endif
26919  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
26920  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
26921  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
26922  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
26923  default:
26924  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26925  return 0;
26926  }
26927 }
26928 /* These are for computing the padding at the end of the struct to align
26929  on the first member of the struct. This will probably the same as above,
26930  but we don't have any guarantees.
26931  */
26932 typedef struct { short x; char c; } __Pyx_pad_short;
26933 typedef struct { int x; char c; } __Pyx_pad_int;
26934 typedef struct { long x; char c; } __Pyx_pad_long;
26935 typedef struct { float x; char c; } __Pyx_pad_float;
26936 typedef struct { double x; char c; } __Pyx_pad_double;
26937 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
26938 typedef struct { void *x; char c; } __Pyx_pad_void_p;
26939 #ifdef HAVE_LONG_LONG
26940 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
26941 #endif
26942 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
26943  switch (ch) {
26944  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26945  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
26946  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
26947  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
26948 #ifdef HAVE_LONG_LONG
26949  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
26950 #endif
26951  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
26952  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
26953  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
26954  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
26955  default:
26956  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26957  return 0;
26958  }
26959 }
26960 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
26961  switch (ch) {
26962  case 'c':
26963  return 'H';
26964  case 'b': case 'h': case 'i':
26965  case 'l': case 'q': case 's': case 'p':
26966  return 'I';
26967  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
26968  return 'U';
26969  case 'f': case 'd': case 'g':
26970  return (is_complex ? 'C' : 'R');
26971  case 'O':
26972  return 'O';
26973  case 'P':
26974  return 'P';
26975  default: {
26976  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26977  return 0;
26978  }
26979  }
26980 }
26981 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
26982  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
26983  const char* expected;
26984  const char* quote;
26985  if (ctx->head == NULL) {
26986  expected = "end";
26987  quote = "";
26988  } else {
26989  expected = ctx->head->field->type->name;
26990  quote = "'";
26991  }
26992  PyErr_Format(PyExc_ValueError,
26993  "Buffer dtype mismatch, expected %s%s%s but got %s",
26994  quote, expected, quote,
26995  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
26996  } else {
26997  __Pyx_StructField* field = ctx->head->field;
26998  __Pyx_StructField* parent = (ctx->head - 1)->field;
26999  PyErr_Format(PyExc_ValueError,
27000  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
27001  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
27002  parent->type->name, field->name);
27003  }
27004 }
27005 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
27006  char group;
27007  size_t size, offset, arraysize = 1;
27008  if (ctx->enc_type == 0) return 0;
27009  if (ctx->head->field->type->arraysize[0]) {
27010  int i, ndim = 0;
27011  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
27012  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
27013  ndim = 1;
27014  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
27015  PyErr_Format(PyExc_ValueError,
27016  "Expected a dimension of size %zu, got %zu",
27017  ctx->head->field->type->arraysize[0], ctx->enc_count);
27018  return -1;
27019  }
27020  }
27021  if (!ctx->is_valid_array) {
27022  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
27023  ctx->head->field->type->ndim, ndim);
27024  return -1;
27025  }
27026  for (i = 0; i < ctx->head->field->type->ndim; i++) {
27027  arraysize *= ctx->head->field->type->arraysize[i];
27028  }
27029  ctx->is_valid_array = 0;
27030  ctx->enc_count = 1;
27031  }
27032  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
27033  do {
27034  __Pyx_StructField* field = ctx->head->field;
27035  __Pyx_TypeInfo* type = field->type;
27036  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
27037  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
27038  } else {
27039  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
27040  }
27041  if (ctx->enc_packmode == '@') {
27042  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
27043  size_t align_mod_offset;
27044  if (align_at == 0) return -1;
27045  align_mod_offset = ctx->fmt_offset % align_at;
27046  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
27047  if (ctx->struct_alignment == 0)
27048  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
27049  ctx->is_complex);
27050  }
27051  if (type->size != size || type->typegroup != group) {
27052  if (type->typegroup == 'C' && type->fields != NULL) {
27053  size_t parent_offset = ctx->head->parent_offset + field->offset;
27054  ++ctx->head;
27055  ctx->head->field = type->fields;
27056  ctx->head->parent_offset = parent_offset;
27057  continue;
27058  }
27059  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
27060  } else {
27061  __Pyx_BufFmt_RaiseExpected(ctx);
27062  return -1;
27063  }
27064  }
27065  offset = ctx->head->parent_offset + field->offset;
27066  if (ctx->fmt_offset != offset) {
27067  PyErr_Format(PyExc_ValueError,
27068  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
27069  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
27070  return -1;
27071  }
27072  ctx->fmt_offset += size;
27073  if (arraysize)
27074  ctx->fmt_offset += (arraysize - 1) * size;
27075  --ctx->enc_count;
27076  while (1) {
27077  if (field == &ctx->root) {
27078  ctx->head = NULL;
27079  if (ctx->enc_count != 0) {
27080  __Pyx_BufFmt_RaiseExpected(ctx);
27081  return -1;
27082  }
27083  break;
27084  }
27085  ctx->head->field = ++field;
27086  if (field->type == NULL) {
27087  --ctx->head;
27088  field = ctx->head->field;
27089  continue;
27090  } else if (field->type->typegroup == 'S') {
27091  size_t parent_offset = ctx->head->parent_offset + field->offset;
27092  if (field->type->fields->type == NULL) continue;
27093  field = field->type->fields;
27094  ++ctx->head;
27095  ctx->head->field = field;
27096  ctx->head->parent_offset = parent_offset;
27097  break;
27098  } else {
27099  break;
27100  }
27101  }
27102  } while (ctx->enc_count);
27103  ctx->enc_type = 0;
27104  ctx->is_complex = 0;
27105  return 0;
27106 }
27107 static PyObject *
27108 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
27109 {
27110  const char *ts = *tsp;
27111  int i = 0, number;
27112  int ndim = ctx->head->field->type->ndim;
27113 ;
27114  ++ts;
27115  if (ctx->new_count != 1) {
27116  PyErr_SetString(PyExc_ValueError,
27117  "Cannot handle repeated arrays in format string");
27118  return NULL;
27119  }
27120  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27121  while (*ts && *ts != ')') {
27122  switch (*ts) {
27123  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
27124  default: break;
27125  }
27126  number = __Pyx_BufFmt_ExpectNumber(&ts);
27127  if (number == -1) return NULL;
27128  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
27129  return PyErr_Format(PyExc_ValueError,
27130  "Expected a dimension of size %zu, got %d",
27131  ctx->head->field->type->arraysize[i], number);
27132  if (*ts != ',' && *ts != ')')
27133  return PyErr_Format(PyExc_ValueError,
27134  "Expected a comma in format string, got '%c'", *ts);
27135  if (*ts == ',') ts++;
27136  i++;
27137  }
27138  if (i != ndim)
27139  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
27140  ctx->head->field->type->ndim, i);
27141  if (!*ts) {
27142  PyErr_SetString(PyExc_ValueError,
27143  "Unexpected end of format string, expected ')'");
27144  return NULL;
27145  }
27146  ctx->is_valid_array = 1;
27147  ctx->new_count = 1;
27148  *tsp = ++ts;
27149  return Py_None;
27150 }
27151 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
27152  int got_Z = 0;
27153  while (1) {
27154  switch(*ts) {
27155  case 0:
27156  if (ctx->enc_type != 0 && ctx->head == NULL) {
27157  __Pyx_BufFmt_RaiseExpected(ctx);
27158  return NULL;
27159  }
27160  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27161  if (ctx->head != NULL) {
27162  __Pyx_BufFmt_RaiseExpected(ctx);
27163  return NULL;
27164  }
27165  return ts;
27166  case ' ':
27167  case '\r':
27168  case '\n':
27169  ++ts;
27170  break;
27171  case '<':
27172  if (!__Pyx_Is_Little_Endian()) {
27173  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
27174  return NULL;
27175  }
27176  ctx->new_packmode = '=';
27177  ++ts;
27178  break;
27179  case '>':
27180  case '!':
27181  if (__Pyx_Is_Little_Endian()) {
27182  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
27183  return NULL;
27184  }
27185  ctx->new_packmode = '=';
27186  ++ts;
27187  break;
27188  case '=':
27189  case '@':
27190  case '^':
27191  ctx->new_packmode = *ts++;
27192  break;
27193  case 'T':
27194  {
27195  const char* ts_after_sub;
27196  size_t i, struct_count = ctx->new_count;
27197  size_t struct_alignment = ctx->struct_alignment;
27198  ctx->new_count = 1;
27199  ++ts;
27200  if (*ts != '{') {
27201  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
27202  return NULL;
27203  }
27204  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27205  ctx->enc_type = 0;
27206  ctx->enc_count = 0;
27207  ctx->struct_alignment = 0;
27208  ++ts;
27209  ts_after_sub = ts;
27210  for (i = 0; i != struct_count; ++i) {
27211  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
27212  if (!ts_after_sub) return NULL;
27213  }
27214  ts = ts_after_sub;
27215  if (struct_alignment) ctx->struct_alignment = struct_alignment;
27216  }
27217  break;
27218  case '}':
27219  {
27220  size_t alignment = ctx->struct_alignment;
27221  ++ts;
27222  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27223  ctx->enc_type = 0;
27224  if (alignment && ctx->fmt_offset % alignment) {
27225  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
27226  }
27227  }
27228  return ts;
27229  case 'x':
27230  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27231  ctx->fmt_offset += ctx->new_count;
27232  ctx->new_count = 1;
27233  ctx->enc_count = 0;
27234  ctx->enc_type = 0;
27235  ctx->enc_packmode = ctx->new_packmode;
27236  ++ts;
27237  break;
27238  case 'Z':
27239  got_Z = 1;
27240  ++ts;
27241  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
27242  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
27243  return NULL;
27244  }
27245  CYTHON_FALLTHROUGH;
27246  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
27247  case 'l': case 'L': case 'q': case 'Q':
27248  case 'f': case 'd': case 'g':
27249  case 'O': case 'p':
27250  if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
27251  ctx->enc_packmode == ctx->new_packmode) {
27252  ctx->enc_count += ctx->new_count;
27253  ctx->new_count = 1;
27254  got_Z = 0;
27255  ++ts;
27256  break;
27257  }
27258  CYTHON_FALLTHROUGH;
27259  case 's':
27260  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27261  ctx->enc_count = ctx->new_count;
27262  ctx->enc_packmode = ctx->new_packmode;
27263  ctx->enc_type = *ts;
27264  ctx->is_complex = got_Z;
27265  ++ts;
27266  ctx->new_count = 1;
27267  got_Z = 0;
27268  break;
27269  case ':':
27270  ++ts;
27271  while(*ts != ':') ++ts;
27272  ++ts;
27273  break;
27274  case '(':
27275  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
27276  break;
27277  default:
27278  {
27279  int number = __Pyx_BufFmt_ExpectNumber(&ts);
27280  if (number == -1) return NULL;
27281  ctx->new_count = (size_t)number;
27282  }
27283  }
27284  }
27285 }
27286 
27287 /* TypeInfoCompare */
27288  static int
27289 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
27290 {
27291  int i;
27292  if (!a || !b)
27293  return 0;
27294  if (a == b)
27295  return 1;
27296  if (a->size != b->size || a->typegroup != b->typegroup ||
27297  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
27298  if (a->typegroup == 'H' || b->typegroup == 'H') {
27299  return a->size == b->size;
27300  } else {
27301  return 0;
27302  }
27303  }
27304  if (a->ndim) {
27305  for (i = 0; i < a->ndim; i++)
27306  if (a->arraysize[i] != b->arraysize[i])
27307  return 0;
27308  }
27309  if (a->typegroup == 'S') {
27310  if (a->flags != b->flags)
27311  return 0;
27312  if (a->fields || b->fields) {
27313  if (!(a->fields && b->fields))
27314  return 0;
27315  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
27316  __Pyx_StructField *field_a = a->fields + i;
27317  __Pyx_StructField *field_b = b->fields + i;
27318  if (field_a->offset != field_b->offset ||
27319  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
27320  return 0;
27321  }
27322  return !a->fields[i].type && !b->fields[i].type;
27323  }
27324  }
27325  return 1;
27326 }
27327 
27328 /* MemviewSliceValidateAndInit */
27329  static int
27330 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
27331 {
27332  if (buf->shape[dim] <= 1)
27333  return 1;
27334  if (buf->strides) {
27335  if (spec & __Pyx_MEMVIEW_CONTIG) {
27336  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
27337  if (buf->strides[dim] != sizeof(void *)) {
27338  PyErr_Format(PyExc_ValueError,
27339  "Buffer is not indirectly contiguous "
27340  "in dimension %d.", dim);
27341  goto fail;
27342  }
27343  } else if (buf->strides[dim] != buf->itemsize) {
27344  PyErr_SetString(PyExc_ValueError,
27345  "Buffer and memoryview are not contiguous "
27346  "in the same dimension.");
27347  goto fail;
27348  }
27349  }
27350  if (spec & __Pyx_MEMVIEW_FOLLOW) {
27351  Py_ssize_t stride = buf->strides[dim];
27352  if (stride < 0)
27353  stride = -stride;
27354  if (stride < buf->itemsize) {
27355  PyErr_SetString(PyExc_ValueError,
27356  "Buffer and memoryview are not contiguous "
27357  "in the same dimension.");
27358  goto fail;
27359  }
27360  }
27361  } else {
27362  if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
27363  PyErr_Format(PyExc_ValueError,
27364  "C-contiguous buffer is not contiguous in "
27365  "dimension %d", dim);
27366  goto fail;
27367  } else if (spec & (__Pyx_MEMVIEW_PTR)) {
27368  PyErr_Format(PyExc_ValueError,
27369  "C-contiguous buffer is not indirect in "
27370  "dimension %d", dim);
27371  goto fail;
27372  } else if (buf->suboffsets) {
27373  PyErr_SetString(PyExc_ValueError,
27374  "Buffer exposes suboffsets but no strides");
27375  goto fail;
27376  }
27377  }
27378  return 1;
27379 fail:
27380  return 0;
27381 }
27382 static int
27383 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
27384 {
27385  if (spec & __Pyx_MEMVIEW_DIRECT) {
27386  if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
27387  PyErr_Format(PyExc_ValueError,
27388  "Buffer not compatible with direct access "
27389  "in dimension %d.", dim);
27390  goto fail;
27391  }
27392  }
27393  if (spec & __Pyx_MEMVIEW_PTR) {
27394  if (!buf->suboffsets || (buf->suboffsets[dim] < 0)) {
27395  PyErr_Format(PyExc_ValueError,
27396  "Buffer is not indirectly accessible "
27397  "in dimension %d.", dim);
27398  goto fail;
27399  }
27400  }
27401  return 1;
27402 fail:
27403  return 0;
27404 }
27405 static int
27406 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
27407 {
27408  int i;
27409  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
27410  Py_ssize_t stride = 1;
27411  for (i = 0; i < ndim; i++) {
27412  if (stride * buf->itemsize != buf->strides[i] &&
27413  buf->shape[i] > 1)
27414  {
27415  PyErr_SetString(PyExc_ValueError,
27416  "Buffer not fortran contiguous.");
27417  goto fail;
27418  }
27419  stride = stride * buf->shape[i];
27420  }
27421  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
27422  Py_ssize_t stride = 1;
27423  for (i = ndim - 1; i >- 1; i--) {
27424  if (stride * buf->itemsize != buf->strides[i] &&
27425  buf->shape[i] > 1) {
27426  PyErr_SetString(PyExc_ValueError,
27427  "Buffer not C contiguous.");
27428  goto fail;
27429  }
27430  stride = stride * buf->shape[i];
27431  }
27432  }
27433  return 1;
27434 fail:
27435  return 0;
27436 }
27437 static int __Pyx_ValidateAndInit_memviewslice(
27438  int *axes_specs,
27439  int c_or_f_flag,
27440  int buf_flags,
27441  int ndim,
27442  __Pyx_TypeInfo *dtype,
27443  __Pyx_BufFmt_StackElem stack[],
27444  __Pyx_memviewslice *memviewslice,
27445  PyObject *original_obj)
27446 {
27447  struct __pyx_memoryview_obj *memview, *new_memview;
27448  __Pyx_RefNannyDeclarations
27449  Py_buffer *buf;
27450  int i, spec = 0, retval = -1;
27451  __Pyx_BufFmt_Context ctx;
27452  int from_memoryview = __pyx_memoryview_check(original_obj);
27453  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
27454  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
27455  original_obj)->typeinfo)) {
27456  memview = (struct __pyx_memoryview_obj *) original_obj;
27457  new_memview = NULL;
27458  } else {
27459  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27460  original_obj, buf_flags, 0, dtype);
27461  new_memview = memview;
27462  if (unlikely(!memview))
27463  goto fail;
27464  }
27465  buf = &memview->view;
27466  if (buf->ndim != ndim) {
27467  PyErr_Format(PyExc_ValueError,
27468  "Buffer has wrong number of dimensions (expected %d, got %d)",
27469  ndim, buf->ndim);
27470  goto fail;
27471  }
27472  if (new_memview) {
27473  __Pyx_BufFmt_Init(&ctx, stack, dtype);
27474  if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
27475  }
27476  if ((unsigned) buf->itemsize != dtype->size) {
27477  PyErr_Format(PyExc_ValueError,
27478  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
27479  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
27480  buf->itemsize,
27481  (buf->itemsize > 1) ? "s" : "",
27482  dtype->name,
27483  dtype->size,
27484  (dtype->size > 1) ? "s" : "");
27485  goto fail;
27486  }
27487  for (i = 0; i < ndim; i++) {
27488  spec = axes_specs[i];
27489  if (!__pyx_check_strides(buf, i, ndim, spec))
27490  goto fail;
27491  if (!__pyx_check_suboffsets(buf, i, ndim, spec))
27492  goto fail;
27493  }
27494  if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
27495  goto fail;
27496  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
27497  new_memview != NULL) == -1)) {
27498  goto fail;
27499  }
27500  retval = 0;
27501  goto no_fail;
27502 fail:
27503  Py_XDECREF(new_memview);
27504  retval = -1;
27505 no_fail:
27506  __Pyx_RefNannyFinishContext();
27507  return retval;
27508 }
27509 
27510 /* ObjectToMemviewSlice */
27511  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj, int writable_flag) {
27512  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27513  __Pyx_BufFmt_StackElem stack[1];
27514  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27515  int retcode;
27516  if (obj == Py_None) {
27517  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27518  return result;
27519  }
27520  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27521  PyBUF_RECORDS_RO | writable_flag, 1,
27522  &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack,
27523  &result, obj);
27524  if (unlikely(retcode == -1))
27525  goto __pyx_fail;
27526  return result;
27527 __pyx_fail:
27528  result.memview = NULL;
27529  result.data = NULL;
27530  return result;
27531 }
27532 
27533 /* ObjectToMemviewSlice */
27534  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *obj, int writable_flag) {
27535  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27536  __Pyx_BufFmt_StackElem stack[1];
27537  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27538  int retcode;
27539  if (obj == Py_None) {
27540  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27541  return result;
27542  }
27543  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27544  PyBUF_RECORDS_RO | writable_flag, 1,
27545  &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack,
27546  &result, obj);
27547  if (unlikely(retcode == -1))
27548  goto __pyx_fail;
27549  return result;
27550 __pyx_fail:
27551  result.memview = NULL;
27552  result.data = NULL;
27553  return result;
27554 }
27555 
27556 /* CIntToPy */
27557  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
27558  const npy_int32 neg_one = (npy_int32) ((npy_int32) 0 - (npy_int32) 1), const_zero = (npy_int32) 0;
27559  const int is_unsigned = neg_one > const_zero;
27560  if (is_unsigned) {
27561  if (sizeof(npy_int32) < sizeof(long)) {
27562  return PyInt_FromLong((long) value);
27563  } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
27564  return PyLong_FromUnsignedLong((unsigned long) value);
27565 #ifdef HAVE_LONG_LONG
27566  } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
27567  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27568 #endif
27569  }
27570  } else {
27571  if (sizeof(npy_int32) <= sizeof(long)) {
27572  return PyInt_FromLong((long) value);
27573 #ifdef HAVE_LONG_LONG
27574  } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
27575  return PyLong_FromLongLong((PY_LONG_LONG) value);
27576 #endif
27577  }
27578  }
27579  {
27580  int one = 1; int little = (int)*(unsigned char *)&one;
27581  unsigned char *bytes = (unsigned char *)&value;
27582  return _PyLong_FromByteArray(bytes, sizeof(npy_int32),
27583  little, !is_unsigned);
27584  }
27585 }
27586 
27587 /* CIntToPy */
27588  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
27589  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
27590  const int is_unsigned = neg_one > const_zero;
27591  if (is_unsigned) {
27592  if (sizeof(int) < sizeof(long)) {
27593  return PyInt_FromLong((long) value);
27594  } else if (sizeof(int) <= sizeof(unsigned long)) {
27595  return PyLong_FromUnsignedLong((unsigned long) value);
27596 #ifdef HAVE_LONG_LONG
27597  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
27598  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27599 #endif
27600  }
27601  } else {
27602  if (sizeof(int) <= sizeof(long)) {
27603  return PyInt_FromLong((long) value);
27604 #ifdef HAVE_LONG_LONG
27605  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
27606  return PyLong_FromLongLong((PY_LONG_LONG) value);
27607 #endif
27608  }
27609  }
27610  {
27611  int one = 1; int little = (int)*(unsigned char *)&one;
27612  unsigned char *bytes = (unsigned char *)&value;
27613  return _PyLong_FromByteArray(bytes, sizeof(int),
27614  little, !is_unsigned);
27615  }
27616 }
27617 
27618 /* Declarations */
27619  #if CYTHON_CCOMPLEX
27620  #ifdef __cplusplus
27621  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27622  return ::std::complex< float >(x, y);
27623  }
27624  #else
27625  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27626  return x + y*(__pyx_t_float_complex)_Complex_I;
27627  }
27628  #endif
27629 #else
27630  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27631  __pyx_t_float_complex z;
27632  z.real = x;
27633  z.imag = y;
27634  return z;
27635  }
27636 #endif
27637 
27638 /* Arithmetic */
27639  #if CYTHON_CCOMPLEX
27640 #else
27641  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27642  return (a.real == b.real) && (a.imag == b.imag);
27643  }
27644  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27645  __pyx_t_float_complex z;
27646  z.real = a.real + b.real;
27647  z.imag = a.imag + b.imag;
27648  return z;
27649  }
27650  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27651  __pyx_t_float_complex z;
27652  z.real = a.real - b.real;
27653  z.imag = a.imag - b.imag;
27654  return z;
27655  }
27656  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27657  __pyx_t_float_complex z;
27658  z.real = a.real * b.real - a.imag * b.imag;
27659  z.imag = a.real * b.imag + a.imag * b.real;
27660  return z;
27661  }
27662  #if 1
27663  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27664  if (b.imag == 0) {
27665  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27666  } else if (fabsf(b.real) >= fabsf(b.imag)) {
27667  if (b.real == 0 && b.imag == 0) {
27668  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
27669  } else {
27670  float r = b.imag / b.real;
27671  float s = (float)(1.0) / (b.real + b.imag * r);
27672  return __pyx_t_float_complex_from_parts(
27673  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27674  }
27675  } else {
27676  float r = b.real / b.imag;
27677  float s = (float)(1.0) / (b.imag + b.real * r);
27678  return __pyx_t_float_complex_from_parts(
27679  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27680  }
27681  }
27682  #else
27683  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27684  if (b.imag == 0) {
27685  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27686  } else {
27687  float denom = b.real * b.real + b.imag * b.imag;
27688  return __pyx_t_float_complex_from_parts(
27689  (a.real * b.real + a.imag * b.imag) / denom,
27690  (a.imag * b.real - a.real * b.imag) / denom);
27691  }
27692  }
27693  #endif
27694  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
27695  __pyx_t_float_complex z;
27696  z.real = -a.real;
27697  z.imag = -a.imag;
27698  return z;
27699  }
27700  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
27701  return (a.real == 0) && (a.imag == 0);
27702  }
27703  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
27704  __pyx_t_float_complex z;
27705  z.real = a.real;
27706  z.imag = -a.imag;
27707  return z;
27708  }
27709  #if 1
27710  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
27711  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27712  return sqrtf(z.real*z.real + z.imag*z.imag);
27713  #else
27714  return hypotf(z.real, z.imag);
27715  #endif
27716  }
27717  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27718  __pyx_t_float_complex z;
27719  float r, lnr, theta, z_r, z_theta;
27720  if (b.imag == 0 && b.real == (int)b.real) {
27721  if (b.real < 0) {
27722  float denom = a.real * a.real + a.imag * a.imag;
27723  a.real = a.real / denom;
27724  a.imag = -a.imag / denom;
27725  b.real = -b.real;
27726  }
27727  switch ((int)b.real) {
27728  case 0:
27729  z.real = 1;
27730  z.imag = 0;
27731  return z;
27732  case 1:
27733  return a;
27734  case 2:
27735  return __Pyx_c_prod_float(a, a);
27736  case 3:
27737  z = __Pyx_c_prod_float(a, a);
27738  return __Pyx_c_prod_float(z, a);
27739  case 4:
27740  z = __Pyx_c_prod_float(a, a);
27741  return __Pyx_c_prod_float(z, z);
27742  }
27743  }
27744  if (a.imag == 0) {
27745  if (a.real == 0) {
27746  return a;
27747  } else if (b.imag == 0) {
27748  z.real = powf(a.real, b.real);
27749  z.imag = 0;
27750  return z;
27751  } else if (a.real > 0) {
27752  r = a.real;
27753  theta = 0;
27754  } else {
27755  r = -a.real;
27756  theta = atan2f(0.0, -1.0);
27757  }
27758  } else {
27759  r = __Pyx_c_abs_float(a);
27760  theta = atan2f(a.imag, a.real);
27761  }
27762  lnr = logf(r);
27763  z_r = expf(lnr * b.real - theta * b.imag);
27764  z_theta = theta * b.real + lnr * b.imag;
27765  z.real = z_r * cosf(z_theta);
27766  z.imag = z_r * sinf(z_theta);
27767  return z;
27768  }
27769  #endif
27770 #endif
27771 
27772 /* Declarations */
27773  #if CYTHON_CCOMPLEX
27774  #ifdef __cplusplus
27775  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27776  return ::std::complex< double >(x, y);
27777  }
27778  #else
27779  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27780  return x + y*(__pyx_t_double_complex)_Complex_I;
27781  }
27782  #endif
27783 #else
27784  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27785  __pyx_t_double_complex z;
27786  z.real = x;
27787  z.imag = y;
27788  return z;
27789  }
27790 #endif
27791 
27792 /* Arithmetic */
27793  #if CYTHON_CCOMPLEX
27794 #else
27795  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27796  return (a.real == b.real) && (a.imag == b.imag);
27797  }
27798  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27799  __pyx_t_double_complex z;
27800  z.real = a.real + b.real;
27801  z.imag = a.imag + b.imag;
27802  return z;
27803  }
27804  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27805  __pyx_t_double_complex z;
27806  z.real = a.real - b.real;
27807  z.imag = a.imag - b.imag;
27808  return z;
27809  }
27810  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27811  __pyx_t_double_complex z;
27812  z.real = a.real * b.real - a.imag * b.imag;
27813  z.imag = a.real * b.imag + a.imag * b.real;
27814  return z;
27815  }
27816  #if 1
27817  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27818  if (b.imag == 0) {
27819  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27820  } else if (fabs(b.real) >= fabs(b.imag)) {
27821  if (b.real == 0 && b.imag == 0) {
27822  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
27823  } else {
27824  double r = b.imag / b.real;
27825  double s = (double)(1.0) / (b.real + b.imag * r);
27826  return __pyx_t_double_complex_from_parts(
27827  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27828  }
27829  } else {
27830  double r = b.real / b.imag;
27831  double s = (double)(1.0) / (b.imag + b.real * r);
27832  return __pyx_t_double_complex_from_parts(
27833  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27834  }
27835  }
27836  #else
27837  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27838  if (b.imag == 0) {
27839  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27840  } else {
27841  double denom = b.real * b.real + b.imag * b.imag;
27842  return __pyx_t_double_complex_from_parts(
27843  (a.real * b.real + a.imag * b.imag) / denom,
27844  (a.imag * b.real - a.real * b.imag) / denom);
27845  }
27846  }
27847  #endif
27848  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
27849  __pyx_t_double_complex z;
27850  z.real = -a.real;
27851  z.imag = -a.imag;
27852  return z;
27853  }
27854  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
27855  return (a.real == 0) && (a.imag == 0);
27856  }
27857  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
27858  __pyx_t_double_complex z;
27859  z.real = a.real;
27860  z.imag = -a.imag;
27861  return z;
27862  }
27863  #if 1
27864  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
27865  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27866  return sqrt(z.real*z.real + z.imag*z.imag);
27867  #else
27868  return hypot(z.real, z.imag);
27869  #endif
27870  }
27871  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27872  __pyx_t_double_complex z;
27873  double r, lnr, theta, z_r, z_theta;
27874  if (b.imag == 0 && b.real == (int)b.real) {
27875  if (b.real < 0) {
27876  double denom = a.real * a.real + a.imag * a.imag;
27877  a.real = a.real / denom;
27878  a.imag = -a.imag / denom;
27879  b.real = -b.real;
27880  }
27881  switch ((int)b.real) {
27882  case 0:
27883  z.real = 1;
27884  z.imag = 0;
27885  return z;
27886  case 1:
27887  return a;
27888  case 2:
27889  return __Pyx_c_prod_double(a, a);
27890  case 3:
27891  z = __Pyx_c_prod_double(a, a);
27892  return __Pyx_c_prod_double(z, a);
27893  case 4:
27894  z = __Pyx_c_prod_double(a, a);
27895  return __Pyx_c_prod_double(z, z);
27896  }
27897  }
27898  if (a.imag == 0) {
27899  if (a.real == 0) {
27900  return a;
27901  } else if (b.imag == 0) {
27902  z.real = pow(a.real, b.real);
27903  z.imag = 0;
27904  return z;
27905  } else if (a.real > 0) {
27906  r = a.real;
27907  theta = 0;
27908  } else {
27909  r = -a.real;
27910  theta = atan2(0.0, -1.0);
27911  }
27912  } else {
27913  r = __Pyx_c_abs_double(a);
27914  theta = atan2(a.imag, a.real);
27915  }
27916  lnr = log(r);
27917  z_r = exp(lnr * b.real - theta * b.imag);
27918  z_theta = theta * b.real + lnr * b.imag;
27919  z.real = z_r * cos(z_theta);
27920  z.imag = z_r * sin(z_theta);
27921  return z;
27922  }
27923  #endif
27924 #endif
27925 
27926 /* CIntToPy */
27927  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
27928  const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
27929  const int is_unsigned = neg_one > const_zero;
27930  if (is_unsigned) {
27931  if (sizeof(enum NPY_TYPES) < sizeof(long)) {
27932  return PyInt_FromLong((long) value);
27933  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
27934  return PyLong_FromUnsignedLong((unsigned long) value);
27935 #ifdef HAVE_LONG_LONG
27936  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
27937  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27938 #endif
27939  }
27940  } else {
27941  if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
27942  return PyInt_FromLong((long) value);
27943 #ifdef HAVE_LONG_LONG
27944  } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
27945  return PyLong_FromLongLong((PY_LONG_LONG) value);
27946 #endif
27947  }
27948  }
27949  {
27950  int one = 1; int little = (int)*(unsigned char *)&one;
27951  unsigned char *bytes = (unsigned char *)&value;
27952  return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
27953  little, !is_unsigned);
27954  }
27955 }
27956 
27957 /* MemviewSliceCopyTemplate */
27958  static __Pyx_memviewslice
27959 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
27960  const char *mode, int ndim,
27961  size_t sizeof_dtype, int contig_flag,
27962  int dtype_is_object)
27963 {
27964  __Pyx_RefNannyDeclarations
27965  int i;
27966  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
27967  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
27968  Py_buffer *buf = &from_memview->view;
27969  PyObject *shape_tuple = NULL;
27970  PyObject *temp_int = NULL;
27971  struct __pyx_array_obj *array_obj = NULL;
27972  struct __pyx_memoryview_obj *memview_obj = NULL;
27973  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
27974  for (i = 0; i < ndim; i++) {
27975  if (from_mvs->suboffsets[i] >= 0) {
27976  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
27977  "indirect dimensions (axis %d)", i);
27978  goto fail;
27979  }
27980  }
27981  shape_tuple = PyTuple_New(ndim);
27982  if (unlikely(!shape_tuple)) {
27983  goto fail;
27984  }
27985  __Pyx_GOTREF(shape_tuple);
27986  for(i = 0; i < ndim; i++) {
27987  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
27988  if(unlikely(!temp_int)) {
27989  goto fail;
27990  } else {
27991  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
27992  temp_int = NULL;
27993  }
27994  }
27995  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
27996  if (unlikely(!array_obj)) {
27997  goto fail;
27998  }
27999  __Pyx_GOTREF(array_obj);
28000  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28001  (PyObject *) array_obj, contig_flag,
28002  dtype_is_object,
28003  from_mvs->memview->typeinfo);
28004  if (unlikely(!memview_obj))
28005  goto fail;
28006  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
28007  goto fail;
28008  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
28009  dtype_is_object) < 0))
28010  goto fail;
28011  goto no_fail;
28012 fail:
28013  __Pyx_XDECREF(new_mvs.memview);
28014  new_mvs.memview = NULL;
28015  new_mvs.data = NULL;
28016 no_fail:
28017  __Pyx_XDECREF(shape_tuple);
28018  __Pyx_XDECREF(temp_int);
28019  __Pyx_XDECREF(array_obj);
28020  __Pyx_RefNannyFinishContext();
28021  return new_mvs;
28022 }
28023 
28024 /* CIntFromPy */
28025  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
28026  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
28027  const int is_unsigned = neg_one > const_zero;
28028 #if PY_MAJOR_VERSION < 3
28029  if (likely(PyInt_Check(x))) {
28030  if (sizeof(int) < sizeof(long)) {
28031  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
28032  } else {
28033  long val = PyInt_AS_LONG(x);
28034  if (is_unsigned && unlikely(val < 0)) {
28035  goto raise_neg_overflow;
28036  }
28037  return (int) val;
28038  }
28039  } else
28040 #endif
28041  if (likely(PyLong_Check(x))) {
28042  if (is_unsigned) {
28043 #if CYTHON_USE_PYLONG_INTERNALS
28044  const digit* digits = ((PyLongObject*)x)->ob_digit;
28045  switch (Py_SIZE(x)) {
28046  case 0: return (int) 0;
28047  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
28048  case 2:
28049  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
28050  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28051  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28052  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
28053  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28054  }
28055  }
28056  break;
28057  case 3:
28058  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
28059  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28060  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28061  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
28062  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28063  }
28064  }
28065  break;
28066  case 4:
28067  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
28068  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28069  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28070  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
28071  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28072  }
28073  }
28074  break;
28075  }
28076 #endif
28077 #if CYTHON_COMPILING_IN_CPYTHON
28078  if (unlikely(Py_SIZE(x) < 0)) {
28079  goto raise_neg_overflow;
28080  }
28081 #else
28082  {
28083  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28084  if (unlikely(result < 0))
28085  return (int) -1;
28086  if (unlikely(result == 1))
28087  goto raise_neg_overflow;
28088  }
28089 #endif
28090  if (sizeof(int) <= sizeof(unsigned long)) {
28091  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
28092 #ifdef HAVE_LONG_LONG
28093  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
28094  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28095 #endif
28096  }
28097  } else {
28098 #if CYTHON_USE_PYLONG_INTERNALS
28099  const digit* digits = ((PyLongObject*)x)->ob_digit;
28100  switch (Py_SIZE(x)) {
28101  case 0: return (int) 0;
28102  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
28103  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
28104  case -2:
28105  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
28106  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28107  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28108  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28109  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28110  }
28111  }
28112  break;
28113  case 2:
28114  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
28115  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28116  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28117  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28118  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28119  }
28120  }
28121  break;
28122  case -3:
28123  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28124  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28125  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28126  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28127  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28128  }
28129  }
28130  break;
28131  case 3:
28132  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
28133  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28134  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28135  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28136  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28137  }
28138  }
28139  break;
28140  case -4:
28141  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28142  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28143  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28144  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28145  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28146  }
28147  }
28148  break;
28149  case 4:
28150  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
28151  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28152  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28153  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28154  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28155  }
28156  }
28157  break;
28158  }
28159 #endif
28160  if (sizeof(int) <= sizeof(long)) {
28161  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
28162 #ifdef HAVE_LONG_LONG
28163  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
28164  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
28165 #endif
28166  }
28167  }
28168  {
28169 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28170  PyErr_SetString(PyExc_RuntimeError,
28171  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28172 #else
28173  int val;
28174  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28175  #if PY_MAJOR_VERSION < 3
28176  if (likely(v) && !PyLong_Check(v)) {
28177  PyObject *tmp = v;
28178  v = PyNumber_Long(tmp);
28179  Py_DECREF(tmp);
28180  }
28181  #endif
28182  if (likely(v)) {
28183  int one = 1; int is_little = (int)*(unsigned char *)&one;
28184  unsigned char *bytes = (unsigned char *)&val;
28185  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28186  bytes, sizeof(val),
28187  is_little, !is_unsigned);
28188  Py_DECREF(v);
28189  if (likely(!ret))
28190  return val;
28191  }
28192 #endif
28193  return (int) -1;
28194  }
28195  } else {
28196  int val;
28197  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28198  if (!tmp) return (int) -1;
28199  val = __Pyx_PyInt_As_int(tmp);
28200  Py_DECREF(tmp);
28201  return val;
28202  }
28203 raise_overflow:
28204  PyErr_SetString(PyExc_OverflowError,
28205  "value too large to convert to int");
28206  return (int) -1;
28207 raise_neg_overflow:
28208  PyErr_SetString(PyExc_OverflowError,
28209  "can't convert negative value to int");
28210  return (int) -1;
28211 }
28212 
28213 /* CIntFromPy */
28214  static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
28215  const npy_int32 neg_one = (npy_int32) ((npy_int32) 0 - (npy_int32) 1), const_zero = (npy_int32) 0;
28216  const int is_unsigned = neg_one > const_zero;
28217 #if PY_MAJOR_VERSION < 3
28218  if (likely(PyInt_Check(x))) {
28219  if (sizeof(npy_int32) < sizeof(long)) {
28220  __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x))
28221  } else {
28222  long val = PyInt_AS_LONG(x);
28223  if (is_unsigned && unlikely(val < 0)) {
28224  goto raise_neg_overflow;
28225  }
28226  return (npy_int32) val;
28227  }
28228  } else
28229 #endif
28230  if (likely(PyLong_Check(x))) {
28231  if (is_unsigned) {
28232 #if CYTHON_USE_PYLONG_INTERNALS
28233  const digit* digits = ((PyLongObject*)x)->ob_digit;
28234  switch (Py_SIZE(x)) {
28235  case 0: return (npy_int32) 0;
28236  case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0])
28237  case 2:
28238  if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
28239  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28240  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28241  } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) {
28242  return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
28243  }
28244  }
28245  break;
28246  case 3:
28247  if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
28248  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28249  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28250  } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) {
28251  return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
28252  }
28253  }
28254  break;
28255  case 4:
28256  if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
28257  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28258  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28259  } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) {
28260  return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
28261  }
28262  }
28263  break;
28264  }
28265 #endif
28266 #if CYTHON_COMPILING_IN_CPYTHON
28267  if (unlikely(Py_SIZE(x) < 0)) {
28268  goto raise_neg_overflow;
28269  }
28270 #else
28271  {
28272  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28273  if (unlikely(result < 0))
28274  return (npy_int32) -1;
28275  if (unlikely(result == 1))
28276  goto raise_neg_overflow;
28277  }
28278 #endif
28279  if (sizeof(npy_int32) <= sizeof(unsigned long)) {
28280  __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
28281 #ifdef HAVE_LONG_LONG
28282  } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
28283  __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28284 #endif
28285  }
28286  } else {
28287 #if CYTHON_USE_PYLONG_INTERNALS
28288  const digit* digits = ((PyLongObject*)x)->ob_digit;
28289  switch (Py_SIZE(x)) {
28290  case 0: return (npy_int32) 0;
28291  case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, (sdigit) (-(sdigit)digits[0]))
28292  case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, +digits[0])
28293  case -2:
28294  if (8 * sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT) {
28295  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28296  __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28297  } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
28298  return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
28299  }
28300  }
28301  break;
28302  case 2:
28303  if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
28304  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28305  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28306  } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
28307  return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
28308  }
28309  }
28310  break;
28311  case -3:
28312  if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
28313  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28314  __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28315  } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
28316  return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
28317  }
28318  }
28319  break;
28320  case 3:
28321  if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
28322  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28323  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28324  } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
28325  return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
28326  }
28327  }
28328  break;
28329  case -4:
28330  if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
28331  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28332  __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28333  } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
28334  return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
28335  }
28336  }
28337  break;
28338  case 4:
28339  if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
28340  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28341  __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28342  } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
28343  return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
28344  }
28345  }
28346  break;
28347  }
28348 #endif
28349  if (sizeof(npy_int32) <= sizeof(long)) {
28350  __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x))
28351 #ifdef HAVE_LONG_LONG
28352  } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
28353  __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x))
28354 #endif
28355  }
28356  }
28357  {
28358 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28359  PyErr_SetString(PyExc_RuntimeError,
28360  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28361 #else
28362  npy_int32 val;
28363  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28364  #if PY_MAJOR_VERSION < 3
28365  if (likely(v) && !PyLong_Check(v)) {
28366  PyObject *tmp = v;
28367  v = PyNumber_Long(tmp);
28368  Py_DECREF(tmp);
28369  }
28370  #endif
28371  if (likely(v)) {
28372  int one = 1; int is_little = (int)*(unsigned char *)&one;
28373  unsigned char *bytes = (unsigned char *)&val;
28374  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28375  bytes, sizeof(val),
28376  is_little, !is_unsigned);
28377  Py_DECREF(v);
28378  if (likely(!ret))
28379  return val;
28380  }
28381 #endif
28382  return (npy_int32) -1;
28383  }
28384  } else {
28385  npy_int32 val;
28386  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28387  if (!tmp) return (npy_int32) -1;
28388  val = __Pyx_PyInt_As_npy_int32(tmp);
28389  Py_DECREF(tmp);
28390  return val;
28391  }
28392 raise_overflow:
28393  PyErr_SetString(PyExc_OverflowError,
28394  "value too large to convert to npy_int32");
28395  return (npy_int32) -1;
28396 raise_neg_overflow:
28397  PyErr_SetString(PyExc_OverflowError,
28398  "can't convert negative value to npy_int32");
28399  return (npy_int32) -1;
28400 }
28401 
28402 /* CIntFromPy */
28403  static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
28404  const size_t neg_one = (size_t) ((size_t) 0 - (size_t) 1), const_zero = (size_t) 0;
28405  const int is_unsigned = neg_one > const_zero;
28406 #if PY_MAJOR_VERSION < 3
28407  if (likely(PyInt_Check(x))) {
28408  if (sizeof(size_t) < sizeof(long)) {
28409  __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
28410  } else {
28411  long val = PyInt_AS_LONG(x);
28412  if (is_unsigned && unlikely(val < 0)) {
28413  goto raise_neg_overflow;
28414  }
28415  return (size_t) val;
28416  }
28417  } else
28418 #endif
28419  if (likely(PyLong_Check(x))) {
28420  if (is_unsigned) {
28421 #if CYTHON_USE_PYLONG_INTERNALS
28422  const digit* digits = ((PyLongObject*)x)->ob_digit;
28423  switch (Py_SIZE(x)) {
28424  case 0: return (size_t) 0;
28425  case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
28426  case 2:
28427  if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
28428  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28429  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28430  } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
28431  return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28432  }
28433  }
28434  break;
28435  case 3:
28436  if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
28437  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28438  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28439  } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
28440  return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28441  }
28442  }
28443  break;
28444  case 4:
28445  if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
28446  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28447  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28448  } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
28449  return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28450  }
28451  }
28452  break;
28453  }
28454 #endif
28455 #if CYTHON_COMPILING_IN_CPYTHON
28456  if (unlikely(Py_SIZE(x) < 0)) {
28457  goto raise_neg_overflow;
28458  }
28459 #else
28460  {
28461  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28462  if (unlikely(result < 0))
28463  return (size_t) -1;
28464  if (unlikely(result == 1))
28465  goto raise_neg_overflow;
28466  }
28467 #endif
28468  if (sizeof(size_t) <= sizeof(unsigned long)) {
28469  __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
28470 #ifdef HAVE_LONG_LONG
28471  } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
28472  __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28473 #endif
28474  }
28475  } else {
28476 #if CYTHON_USE_PYLONG_INTERNALS
28477  const digit* digits = ((PyLongObject*)x)->ob_digit;
28478  switch (Py_SIZE(x)) {
28479  case 0: return (size_t) 0;
28480  case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
28481  case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0])
28482  case -2:
28483  if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
28484  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28485  __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28486  } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
28487  return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
28488  }
28489  }
28490  break;
28491  case 2:
28492  if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
28493  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28494  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28495  } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
28496  return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
28497  }
28498  }
28499  break;
28500  case -3:
28501  if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
28502  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28503  __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28504  } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
28505  return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
28506  }
28507  }
28508  break;
28509  case 3:
28510  if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
28511  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28512  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28513  } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
28514  return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
28515  }
28516  }
28517  break;
28518  case -4:
28519  if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
28520  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28521  __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28522  } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
28523  return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
28524  }
28525  }
28526  break;
28527  case 4:
28528  if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
28529  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28530  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28531  } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
28532  return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
28533  }
28534  }
28535  break;
28536  }
28537 #endif
28538  if (sizeof(size_t) <= sizeof(long)) {
28539  __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
28540 #ifdef HAVE_LONG_LONG
28541  } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
28542  __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
28543 #endif
28544  }
28545  }
28546  {
28547 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28548  PyErr_SetString(PyExc_RuntimeError,
28549  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28550 #else
28551  size_t val;
28552  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28553  #if PY_MAJOR_VERSION < 3
28554  if (likely(v) && !PyLong_Check(v)) {
28555  PyObject *tmp = v;
28556  v = PyNumber_Long(tmp);
28557  Py_DECREF(tmp);
28558  }
28559  #endif
28560  if (likely(v)) {
28561  int one = 1; int is_little = (int)*(unsigned char *)&one;
28562  unsigned char *bytes = (unsigned char *)&val;
28563  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28564  bytes, sizeof(val),
28565  is_little, !is_unsigned);
28566  Py_DECREF(v);
28567  if (likely(!ret))
28568  return val;
28569  }
28570 #endif
28571  return (size_t) -1;
28572  }
28573  } else {
28574  size_t val;
28575  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28576  if (!tmp) return (size_t) -1;
28577  val = __Pyx_PyInt_As_size_t(tmp);
28578  Py_DECREF(tmp);
28579  return val;
28580  }
28581 raise_overflow:
28582  PyErr_SetString(PyExc_OverflowError,
28583  "value too large to convert to size_t");
28584  return (size_t) -1;
28585 raise_neg_overflow:
28586  PyErr_SetString(PyExc_OverflowError,
28587  "can't convert negative value to size_t");
28588  return (size_t) -1;
28589 }
28590 
28591 /* CIntFromPy */
28592  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
28593  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
28594  const int is_unsigned = neg_one > const_zero;
28595 #if PY_MAJOR_VERSION < 3
28596  if (likely(PyInt_Check(x))) {
28597  if (sizeof(long) < sizeof(long)) {
28598  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
28599  } else {
28600  long val = PyInt_AS_LONG(x);
28601  if (is_unsigned && unlikely(val < 0)) {
28602  goto raise_neg_overflow;
28603  }
28604  return (long) val;
28605  }
28606  } else
28607 #endif
28608  if (likely(PyLong_Check(x))) {
28609  if (is_unsigned) {
28610 #if CYTHON_USE_PYLONG_INTERNALS
28611  const digit* digits = ((PyLongObject*)x)->ob_digit;
28612  switch (Py_SIZE(x)) {
28613  case 0: return (long) 0;
28614  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
28615  case 2:
28616  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28617  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28618  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28619  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
28620  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28621  }
28622  }
28623  break;
28624  case 3:
28625  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28626  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28627  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28628  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
28629  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28630  }
28631  }
28632  break;
28633  case 4:
28634  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28635  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28636  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28637  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
28638  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28639  }
28640  }
28641  break;
28642  }
28643 #endif
28644 #if CYTHON_COMPILING_IN_CPYTHON
28645  if (unlikely(Py_SIZE(x) < 0)) {
28646  goto raise_neg_overflow;
28647  }
28648 #else
28649  {
28650  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28651  if (unlikely(result < 0))
28652  return (long) -1;
28653  if (unlikely(result == 1))
28654  goto raise_neg_overflow;
28655  }
28656 #endif
28657  if (sizeof(long) <= sizeof(unsigned long)) {
28658  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
28659 #ifdef HAVE_LONG_LONG
28660  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28661  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28662 #endif
28663  }
28664  } else {
28665 #if CYTHON_USE_PYLONG_INTERNALS
28666  const digit* digits = ((PyLongObject*)x)->ob_digit;
28667  switch (Py_SIZE(x)) {
28668  case 0: return (long) 0;
28669  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
28670  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
28671  case -2:
28672  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
28673  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28674  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28675  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28676  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28677  }
28678  }
28679  break;
28680  case 2:
28681  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28682  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28683  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28684  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28685  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28686  }
28687  }
28688  break;
28689  case -3:
28690  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28691  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28692  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28693  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28694  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28695  }
28696  }
28697  break;
28698  case 3:
28699  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28700  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28701  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28702  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28703  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28704  }
28705  }
28706  break;
28707  case -4:
28708  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28709  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28710  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28711  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28712  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28713  }
28714  }
28715  break;
28716  case 4:
28717  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28718  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28719  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28720  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28721  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28722  }
28723  }
28724  break;
28725  }
28726 #endif
28727  if (sizeof(long) <= sizeof(long)) {
28728  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
28729 #ifdef HAVE_LONG_LONG
28730  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28731  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
28732 #endif
28733  }
28734  }
28735  {
28736 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28737  PyErr_SetString(PyExc_RuntimeError,
28738  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28739 #else
28740  long val;
28741  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28742  #if PY_MAJOR_VERSION < 3
28743  if (likely(v) && !PyLong_Check(v)) {
28744  PyObject *tmp = v;
28745  v = PyNumber_Long(tmp);
28746  Py_DECREF(tmp);
28747  }
28748  #endif
28749  if (likely(v)) {
28750  int one = 1; int is_little = (int)*(unsigned char *)&one;
28751  unsigned char *bytes = (unsigned char *)&val;
28752  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28753  bytes, sizeof(val),
28754  is_little, !is_unsigned);
28755  Py_DECREF(v);
28756  if (likely(!ret))
28757  return val;
28758  }
28759 #endif
28760  return (long) -1;
28761  }
28762  } else {
28763  long val;
28764  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28765  if (!tmp) return (long) -1;
28766  val = __Pyx_PyInt_As_long(tmp);
28767  Py_DECREF(tmp);
28768  return val;
28769  }
28770 raise_overflow:
28771  PyErr_SetString(PyExc_OverflowError,
28772  "value too large to convert to long");
28773  return (long) -1;
28774 raise_neg_overflow:
28775  PyErr_SetString(PyExc_OverflowError,
28776  "can't convert negative value to long");
28777  return (long) -1;
28778 }
28779 
28780 /* CIntToPy */
28781  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
28782  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
28783  const int is_unsigned = neg_one > const_zero;
28784  if (is_unsigned) {
28785  if (sizeof(long) < sizeof(long)) {
28786  return PyInt_FromLong((long) value);
28787  } else if (sizeof(long) <= sizeof(unsigned long)) {
28788  return PyLong_FromUnsignedLong((unsigned long) value);
28789 #ifdef HAVE_LONG_LONG
28790  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28791  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28792 #endif
28793  }
28794  } else {
28795  if (sizeof(long) <= sizeof(long)) {
28796  return PyInt_FromLong((long) value);
28797 #ifdef HAVE_LONG_LONG
28798  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28799  return PyLong_FromLongLong((PY_LONG_LONG) value);
28800 #endif
28801  }
28802  }
28803  {
28804  int one = 1; int little = (int)*(unsigned char *)&one;
28805  unsigned char *bytes = (unsigned char *)&value;
28806  return _PyLong_FromByteArray(bytes, sizeof(long),
28807  little, !is_unsigned);
28808  }
28809 }
28810 
28811 /* CIntFromPy */
28812  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
28813  const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0;
28814  const int is_unsigned = neg_one > const_zero;
28815 #if PY_MAJOR_VERSION < 3
28816  if (likely(PyInt_Check(x))) {
28817  if (sizeof(char) < sizeof(long)) {
28818  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
28819  } else {
28820  long val = PyInt_AS_LONG(x);
28821  if (is_unsigned && unlikely(val < 0)) {
28822  goto raise_neg_overflow;
28823  }
28824  return (char) val;
28825  }
28826  } else
28827 #endif
28828  if (likely(PyLong_Check(x))) {
28829  if (is_unsigned) {
28830 #if CYTHON_USE_PYLONG_INTERNALS
28831  const digit* digits = ((PyLongObject*)x)->ob_digit;
28832  switch (Py_SIZE(x)) {
28833  case 0: return (char) 0;
28834  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
28835  case 2:
28836  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28837  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28838  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28839  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
28840  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28841  }
28842  }
28843  break;
28844  case 3:
28845  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28846  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28847  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28848  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
28849  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28850  }
28851  }
28852  break;
28853  case 4:
28854  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28855  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28856  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28857  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
28858  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28859  }
28860  }
28861  break;
28862  }
28863 #endif
28864 #if CYTHON_COMPILING_IN_CPYTHON
28865  if (unlikely(Py_SIZE(x) < 0)) {
28866  goto raise_neg_overflow;
28867  }
28868 #else
28869  {
28870  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28871  if (unlikely(result < 0))
28872  return (char) -1;
28873  if (unlikely(result == 1))
28874  goto raise_neg_overflow;
28875  }
28876 #endif
28877  if (sizeof(char) <= sizeof(unsigned long)) {
28878  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
28879 #ifdef HAVE_LONG_LONG
28880  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
28881  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28882 #endif
28883  }
28884  } else {
28885 #if CYTHON_USE_PYLONG_INTERNALS
28886  const digit* digits = ((PyLongObject*)x)->ob_digit;
28887  switch (Py_SIZE(x)) {
28888  case 0: return (char) 0;
28889  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
28890  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
28891  case -2:
28892  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
28893  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28894  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28895  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28896  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28897  }
28898  }
28899  break;
28900  case 2:
28901  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28902  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28903  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28904  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28905  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28906  }
28907  }
28908  break;
28909  case -3:
28910  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28911  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28912  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28913  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28914  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28915  }
28916  }
28917  break;
28918  case 3:
28919  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28920  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28921  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28922  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28923  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28924  }
28925  }
28926  break;
28927  case -4:
28928  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28929  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28930  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28931  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28932  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28933  }
28934  }
28935  break;
28936  case 4:
28937  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28938  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28939  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28940  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28941  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28942  }
28943  }
28944  break;
28945  }
28946 #endif
28947  if (sizeof(char) <= sizeof(long)) {
28948  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
28949 #ifdef HAVE_LONG_LONG
28950  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
28951  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
28952 #endif
28953  }
28954  }
28955  {
28956 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28957  PyErr_SetString(PyExc_RuntimeError,
28958  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28959 #else
28960  char val;
28961  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28962  #if PY_MAJOR_VERSION < 3
28963  if (likely(v) && !PyLong_Check(v)) {
28964  PyObject *tmp = v;
28965  v = PyNumber_Long(tmp);
28966  Py_DECREF(tmp);
28967  }
28968  #endif
28969  if (likely(v)) {
28970  int one = 1; int is_little = (int)*(unsigned char *)&one;
28971  unsigned char *bytes = (unsigned char *)&val;
28972  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28973  bytes, sizeof(val),
28974  is_little, !is_unsigned);
28975  Py_DECREF(v);
28976  if (likely(!ret))
28977  return val;
28978  }
28979 #endif
28980  return (char) -1;
28981  }
28982  } else {
28983  char val;
28984  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28985  if (!tmp) return (char) -1;
28986  val = __Pyx_PyInt_As_char(tmp);
28987  Py_DECREF(tmp);
28988  return val;
28989  }
28990 raise_overflow:
28991  PyErr_SetString(PyExc_OverflowError,
28992  "value too large to convert to char");
28993  return (char) -1;
28994 raise_neg_overflow:
28995  PyErr_SetString(PyExc_OverflowError,
28996  "can't convert negative value to char");
28997  return (char) -1;
28998 }
28999 
29000 /* CheckBinaryVersion */
29001  static int __Pyx_check_binary_version(void) {
29002  char ctversion[4], rtversion[4];
29003  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
29004  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
29005  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
29006  char message[200];
29007  PyOS_snprintf(message, sizeof(message),
29008  "compiletime version %s of module '%.100s' "
29009  "does not match runtime version %s",
29010  ctversion, __Pyx_MODULE_NAME, rtversion);
29011  return PyErr_WarnEx(NULL, message, 1);
29012  }
29013  return 0;
29014 }
29015 
29016 /* InitStrings */
29017  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
29018  while (t->p) {
29019  #if PY_MAJOR_VERSION < 3
29020  if (t->is_unicode) {
29021  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
29022  } else if (t->intern) {
29023  *t->p = PyString_InternFromString(t->s);
29024  } else {
29025  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
29026  }
29027  #else
29028  if (t->is_unicode | t->is_str) {
29029  if (t->intern) {
29030  *t->p = PyUnicode_InternFromString(t->s);
29031  } else if (t->encoding) {
29032  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
29033  } else {
29034  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
29035  }
29036  } else {
29037  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
29038  }
29039  #endif
29040  if (!*t->p)
29041  return -1;
29042  if (PyObject_Hash(*t->p) == -1)
29043  return -1;
29044  ++t;
29045  }
29046  return 0;
29047 }
29048 
29049 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
29050  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29051 }
29052 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
29053  Py_ssize_t ignore;
29054  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29055 }
29056 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29057 #if !CYTHON_PEP393_ENABLED
29058 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29059  char* defenc_c;
29060  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
29061  if (!defenc) return NULL;
29062  defenc_c = PyBytes_AS_STRING(defenc);
29063 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29064  {
29065  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
29066  char* c;
29067  for (c = defenc_c; c < end; c++) {
29068  if ((unsigned char) (*c) >= 128) {
29069  PyUnicode_AsASCIIString(o);
29070  return NULL;
29071  }
29072  }
29073  }
29074 #endif
29075  *length = PyBytes_GET_SIZE(defenc);
29076  return defenc_c;
29077 }
29078 #else
29079 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29080  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
29081 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29082  if (likely(PyUnicode_IS_ASCII(o))) {
29083  *length = PyUnicode_GET_LENGTH(o);
29084  return PyUnicode_AsUTF8(o);
29085  } else {
29086  PyUnicode_AsASCIIString(o);
29087  return NULL;
29088  }
29089 #else
29090  return PyUnicode_AsUTF8AndSize(o, length);
29091 #endif
29092 }
29093 #endif
29094 #endif
29095 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29096 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29097  if (
29098 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29099  __Pyx_sys_getdefaultencoding_not_ascii &&
29100 #endif
29101  PyUnicode_Check(o)) {
29102  return __Pyx_PyUnicode_AsStringAndSize(o, length);
29103  } else
29104 #endif
29105 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29106  if (PyByteArray_Check(o)) {
29107  *length = PyByteArray_GET_SIZE(o);
29108  return PyByteArray_AS_STRING(o);
29109  } else
29110 #endif
29111  {
29112  char* result;
29113  int r = PyBytes_AsStringAndSize(o, &result, length);
29114  if (unlikely(r < 0)) {
29115  return NULL;
29116  } else {
29117  return result;
29118  }
29119  }
29120 }
29121 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
29122  int is_true = x == Py_True;
29123  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
29124  else return PyObject_IsTrue(x);
29125 }
29126 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
29127  int retval;
29128  if (unlikely(!x)) return -1;
29129  retval = __Pyx_PyObject_IsTrue(x);
29130  Py_DECREF(x);
29131  return retval;
29132 }
29133 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
29134 #if PY_MAJOR_VERSION >= 3
29135  if (PyLong_Check(result)) {
29136  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29137  "__int__ returned non-int (type %.200s). "
29138  "The ability to return an instance of a strict subclass of int "
29139  "is deprecated, and may be removed in a future version of Python.",
29140  Py_TYPE(result)->tp_name)) {
29141  Py_DECREF(result);
29142  return NULL;
29143  }
29144  return result;
29145  }
29146 #endif
29147  PyErr_Format(PyExc_TypeError,
29148  "__%.4s__ returned non-%.4s (type %.200s)",
29149  type_name, type_name, Py_TYPE(result)->tp_name);
29150  Py_DECREF(result);
29151  return NULL;
29152 }
29153 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29154 #if CYTHON_USE_TYPE_SLOTS
29155  PyNumberMethods *m;
29156 #endif
29157  const char *name = NULL;
29158  PyObject *res = NULL;
29159 #if PY_MAJOR_VERSION < 3
29160  if (likely(PyInt_Check(x) || PyLong_Check(x)))
29161 #else
29162  if (likely(PyLong_Check(x)))
29163 #endif
29164  return __Pyx_NewRef(x);
29165 #if CYTHON_USE_TYPE_SLOTS
29166  m = Py_TYPE(x)->tp_as_number;
29167  #if PY_MAJOR_VERSION < 3
29168  if (m && m->nb_int) {
29169  name = "int";
29170  res = m->nb_int(x);
29171  }
29172  else if (m && m->nb_long) {
29173  name = "long";
29174  res = m->nb_long(x);
29175  }
29176  #else
29177  if (likely(m && m->nb_int)) {
29178  name = "int";
29179  res = m->nb_int(x);
29180  }
29181  #endif
29182 #else
29183  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29184  res = PyNumber_Int(x);
29185  }
29186 #endif
29187  if (likely(res)) {
29188 #if PY_MAJOR_VERSION < 3
29189  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29190 #else
29191  if (unlikely(!PyLong_CheckExact(res))) {
29192 #endif
29193  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29194  }
29195  }
29196  else if (!PyErr_Occurred()) {
29197  PyErr_SetString(PyExc_TypeError,
29198  "an integer is required");
29199  }
29200  return res;
29201 }
29202 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29203  Py_ssize_t ival;
29204  PyObject *x;
29205 #if PY_MAJOR_VERSION < 3
29206  if (likely(PyInt_CheckExact(b))) {
29207  if (sizeof(Py_ssize_t) >= sizeof(long))
29208  return PyInt_AS_LONG(b);
29209  else
29210  return PyInt_AsSsize_t(b);
29211  }
29212 #endif
29213  if (likely(PyLong_CheckExact(b))) {
29214  #if CYTHON_USE_PYLONG_INTERNALS
29215  const digit* digits = ((PyLongObject*)b)->ob_digit;
29216  const Py_ssize_t size = Py_SIZE(b);
29217  if (likely(__Pyx_sst_abs(size) <= 1)) {
29218  ival = likely(size) ? digits[0] : 0;
29219  if (size == -1) ival = -ival;
29220  return ival;
29221  } else {
29222  switch (size) {
29223  case 2:
29224  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29225  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29226  }
29227  break;
29228  case -2:
29229  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29230  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29231  }
29232  break;
29233  case 3:
29234  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29235  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29236  }
29237  break;
29238  case -3:
29239  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29240  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29241  }
29242  break;
29243  case 4:
29244  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29245  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29246  }
29247  break;
29248  case -4:
29249  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29250  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29251  }
29252  break;
29253  }
29254  }
29255  #endif
29256  return PyLong_AsSsize_t(b);
29257  }
29258  x = PyNumber_Index(b);
29259  if (!x) return -1;
29260  ival = PyInt_AsSsize_t(x);
29261  Py_DECREF(x);
29262  return ival;
29263 }
29264 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
29265  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29266 }
29267 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
29268  return PyInt_FromSize_t(ival);
29269 }
29270 
29271 
29272 #endif /* Py_PYTHON_H */
Double c
Definition: Headers.h:53
Double f
Definition: Headers.h:53
Int ns
Definition: Headers.h:27
double pos(double a)
Double * z
Definition: Headers.h:40
Int n
Definition: Headers.h:27
Double s
Definition: Headers.h:53
Int number
Definition: Headers.h:27
#define nnz
Definition: Richards.h:9
Double u
Definition: Headers.h:53
Double L
Definition: Headers.h:53
Double q
Definition: Headers.h:53
Double v
Definition: Headers.h:53
Double r
Definition: Headers.h:53
Double T
Definition: Headers.h:53
Double U
Definition: Headers.h:53